shake-ext 0.3.0.0 → 0.3.1.0
raw patch · 2 files changed
+11/−1 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Development.Shake.Linters: atsfmt :: String -> [FilePath] -> Action ()
Files
- shake-ext.cabal +1/−1
- src/Development/Shake/Linters.hs +10/−0
shake-ext.cabal view
@@ -1,5 +1,5 @@ name: shake-ext-version: 0.3.0.0+version: 0.3.1.0 synopsis: Helper functions for linting with shake description: This package provides several linters out of the box, as well as functionality for building ATS source files with [shake](http://shakebuild.com/). homepage: https://hub.darcs.net/vmchale/shake-ext
src/Development/Shake/Linters.hs view
@@ -5,11 +5,21 @@ , hlint , shellcheck , ghc+ , atsfmt , module Development.Shake.FileDetect ) where import Development.Shake import Development.Shake.FileDetect++checkIdempotent :: String -> FilePath -> Action ()+checkIdempotent s p = do+ contents <- liftIO $ readFile p+ (Stdout out) <- cmd (s ++ " " ++ p)+ if contents == out then pure () else error "formatter is not fully applied!"++atsfmt :: String -> [FilePath] -> Action ()+atsfmt s = mapM_ (checkIdempotent s) checkFiles :: String -> [FilePath] -> Action () checkFiles str = mapM_ (cmd_ . ((str ++ " ") ++))