diff options
author | Matthew Kennerly <mtkennerly@gmail.com> | 2017-11-28 06:44:43 -0500 |
---|---|---|
committer | Jasper Van der Jeugt <jaspervdj@gmail.com> | 2017-11-28 12:44:43 +0100 |
commit | 3a5ec324a426f0207ae895471b5c52d21f893859 (patch) | |
tree | 3bdf5bef8a415912cc636441e6dab11d2828bea1 /lib | |
parent | 3bfd8be6e1c6a5e90b1cdf9ee5723e93de26d409 (diff) | |
download | stylish-haskell-3a5ec324a426f0207ae895471b5c52d21f893859.tar.gz |
Avoid unpaired parenthesis when import doesn't specify any items
Fix #185
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Language/Haskell/Stylish/Step/Imports.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Language/Haskell/Stylish/Step/Imports.hs b/lib/Language/Haskell/Stylish/Step/Imports.hs index 2284f3d..927719c 100644 --- a/lib/Language/Haskell/Stylish/Step/Imports.hs +++ b/lib/Language/Haskell/Stylish/Step/Imports.hs @@ -311,7 +311,11 @@ prettyImport columns Options{..} padQualified padName longest imp ( mapSpecs ( withHead ("( " ++) . withTail (", " ++)) - ++ [")"]) + ++ closer) + where + closer = if null importSpecs + then [] + else [")"] paddedBase = base $ padImport $ compoundImportName imp |