hfmt 0.0.2.0 → 0.0.2.1
raw patch · 4 files changed
+6/−7 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- app/Actions.hs +1/−1
- app/Main.hs +4/−2
- hfmt.cabal +1/−1
- src/Language/Haskell/Format/HLint.hs +0/−3
app/Actions.hs view
@@ -33,7 +33,7 @@ putStrLn (path ++ ":") mapM_ (putStr . show) (suggestions reformatted) putStr (showDiff source (reformattedSource reformatted)) -printDiff (InputFromStdIn) source reformatted = do +printDiff InputFromStdIn source reformatted = do mapM_ (putStr . show) (suggestions reformatted) putStr (showDiff source (reformattedSource reformatted))
app/Main.hs view
@@ -28,8 +28,10 @@ runFormatter :: Formatter -> Options -> IO Bool runFormatter formatter options = - P.any sourceChangedOrHasSuggestions (inputFiles >-> P.map reformat >-> P.mapM writeOutput) + anyStrict sourceChangedOrHasSuggestions (inputFiles >-> P.map reformat >-> P.mapM writeOutput) where + anyStrict :: Monad m => (a -> Bool) -> Producer a m () -> m Bool + anyStrict f = P.fold (\acc x -> acc || f x) False id inputFiles = readInputFiles options reformat = applyFormatter formatter writeOutput = Actions.act options @@ -44,7 +46,7 @@ readInputFile :: InputFile -> IO InputFileWithSource readInputFile (InputFilePath path) = InputFileWithSource (InputFilePath path) <$> readSource path -readInputFile (InputFromStdIn) = InputFileWithSource InputFromStdIn <$> readStdin +readInputFile InputFromStdIn = InputFileWithSource InputFromStdIn <$> readStdin applyFormatter :: Formatter -> InputFileWithSource -> ReformatResult applyFormatter (Formatter format) (InputFileWithSource input source) =
hfmt.cabal view
@@ -1,5 +1,5 @@ name: hfmt -version: 0.0.2.0 +version: 0.0.2.1 synopsis: Haskell source code formatter description: Inspired by gofmt. Built using hlint, hindent, and stylish-haskell. license: MIT
src/Language/Haskell/Format/HLint.hs view
@@ -4,11 +4,8 @@ import Language.Haskell.Format.Internal import Control.Applicative -import Data.Maybe import Language.Haskell.Exts.Annotated as Hse import Language.Haskell.HLint3 hiding (autoSettings) - -type Settings = (ParseMode, [Classify], Hint) formatter = undefined