stylish-haskell 0.5.1.0 → 0.5.2.0
raw patch · 3 files changed
+18/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- src/Language/Haskell/Stylish/Step/Imports.hs +11/−7
- stylish-haskell.cabal +1/−1
- tests/Language/Haskell/Stylish/Step/Imports/Tests.hs +6/−2
src/Language/Haskell/Stylish/Step/Imports.hs view
@@ -112,11 +112,15 @@ prettyImport columns padQualified padName longest imp = wrap columns base (length base + 2) $ (if hiding then ("hiding" :) else id) $- withInit (++ ",") $- withHead ("(" ++) $- withLast (++ ")") $- map prettyImportSpec $- importSpecs+ case importSpecs of+ Nothing -> [] -- Import everything+ Just [] -> ["()"] -- Instance only imports+ Just is ->+ withInit (++ ",") $+ withHead ("(" ++) $+ withLast (++ ")") $+ map prettyImportSpec $+ is where base = unwords $ concat [ ["import"]@@ -128,8 +132,8 @@ ] (hiding, importSpecs) = case H.importSpecs imp of- Just (H.ImportSpecList _ h l) -> (h, l)- _ -> (False, [])+ Just (H.ImportSpecList _ h l) -> (h, Just l)+ _ -> (False, Nothing) hasExtras = isJust (H.importAs imp) || isJust (H.importSpecs imp)
stylish-haskell.cabal view
@@ -1,5 +1,5 @@ Name: stylish-haskell-Version: 0.5.1.0+Version: 0.5.2.0 Synopsis: Haskell code prettifier Homepage: https://github.com/jaspervdj/stylish-haskell License: BSD3
tests/Language/Haskell/Stylish/Step/Imports/Tests.hs view
@@ -32,6 +32,7 @@ , "" , "import qualified Data.Map as M" , "import Control.Monad"+ , "import Only.Instances()" , "import Data.Map (lookup, (!), insert, Map)" , "" , "import Herp.Derp.Internals hiding (foo)"@@ -51,6 +52,7 @@ , "import Control.Monad" , "import Data.Map (Map, insert, lookup, (!))" , "import qualified Data.Map as M"+ , "import Only.Instances ()" , "" , "import Foo (Bar (..))" , "import Herp.Derp.Internals hiding (foo)"@@ -67,8 +69,9 @@ [ "module Herp where" , "" , "import Control.Monad"- , "import Data.Map (Map, insert, lookup, (!))"- , "import qualified Data.Map as M"+ , "import Data.Map (Map, insert, lookup, (!))"+ , "import qualified Data.Map as M"+ , "import Only.Instances ()" , "" , "import Foo (Bar (..))" , "import Herp.Derp.Internals hiding (foo)"@@ -87,6 +90,7 @@ , "import Control.Monad" , "import Data.Map (Map, insert, lookup, (!))" , "import qualified Data.Map as M"+ , "import Only.Instances ()" , "" , "import Foo (Bar (..))" , "import Herp.Derp.Internals hiding (foo)"