stylish-haskell 0.7.0.0 → 0.7.1.0
raw patch · 4 files changed
+39/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGELOG +3/−0
- lib/Language/Haskell/Stylish/Step/Imports.hs +16/−1
- stylish-haskell.cabal +1/−1
- tests/Language/Haskell/Stylish/Step/Imports/Tests.hs +19/−0
CHANGELOG view
@@ -1,5 +1,8 @@ # CHANGELOG +- 0.7.1.0+ * Keep `safe` and `{-# SOURCE #-}` import annotations (by Moritz Drexl)+ - 0.7.0.0 * If there's parse errors, show these and exit with code 1 * Bump `aeson` to 1.1
lib/Language/Haskell/Stylish/Step/Imports.hs view
@@ -235,6 +235,8 @@ base' baseName importAs hasHiding' = unwords $ concat $ filter (not . null) [ ["import"]+ , source+ , safe , qualified , show <$> maybeToList (H.importPkg imp) , [baseName]@@ -259,8 +261,21 @@ qualified | H.importQualified imp = ["qualified"]- | padQualified = [" "]+ | padQualified =+ if H.importSrc imp+ then []+ else if H.importSafe imp+ then [" "]+ else [" "] | otherwise = []++ safe+ | H.importSafe imp = ["safe"]+ | otherwise = []++ source+ | H.importSrc imp = ["{-# SOURCE #-}"]+ | otherwise = [] mapSpecs f = case importSpecs of Nothing -> [] -- Import everything
stylish-haskell.cabal view
@@ -1,5 +1,5 @@ Name: stylish-haskell-Version: 0.7.0.0+Version: 0.7.1.0 Synopsis: Haskell code prettifier Homepage: https://github.com/jaspervdj/stylish-haskell License: BSD3
tests/Language/Haskell/Stylish/Step/Imports/Tests.hs view
@@ -46,6 +46,7 @@ , testCase "case 19b" case19b , testCase "case 19d" case19c , testCase "case 19d" case19d+ , testCase "case 20" case20 ] @@ -511,4 +512,22 @@ , "import Prelude ()" , "" , "import Data.List (foldl', intercalate, intersperse)"+ ]++--------------------------------------------------------------------------------+case20 :: Assertion+case20 = expected+ @=? testStep (step 80 defaultOptions) input'+ where+ expected = unlines+ [ "import {-# SOURCE #-} Data.ByteString as BS"+ , "import qualified Data.Map as Map"+ , "import Data.Set (empty)"+ , "import {-# SOURCE #-} qualified Data.Text as T"+ ]+ input' = unlines+ [ "import {-# SOURCE #-} Data.ByteString as BS"+ , "import {-# SOURCE #-} qualified Data.Text as T"+ , "import qualified Data.Map as Map"+ , "import Data.Set (empty)" ]