hlint 2.0.6 → 2.0.7
raw patch · 6 files changed
+23/−13 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +2/−0
- README.md +1/−1
- hlint.cabal +1/−1
- src/CmdLine.hs +5/−1
- src/Config/Type.hs +1/−1
- src/HLint.hs +13/−9
CHANGES.txt view
@@ -1,5 +1,7 @@ Changelog for HLint +2.0.7+ #340, fix for directory arguments in the .hlint.yaml 2.0.6 Do statements are not redundant if they change an operator parse #333, simplify labels on Parse error, makes it easier to ignore
README.md view
@@ -64,7 +64,7 @@ **Travis:** Execute the following command: - wget https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh -O - --quiet | sh -s .+ curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s . The arguments after `-s` are passed to `hlint`, so modify the final `.` if you want other arguments.
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hlint-version: 2.0.6+version: 2.0.7 license: BSD3 license-file: LICENSE category: Development
src/CmdLine.hs view
@@ -242,7 +242,11 @@ x <\> y = x </> y -resolveFile :: Cmd -> Maybe FilePath -> FilePath -> IO [FilePath]+resolveFile+ :: Cmd+ -> Maybe FilePath -- ^ Temporary file+ -> FilePath -- ^ File to resolve, may be "-" for stdin+ -> IO [FilePath] resolveFile cmd = getFile (cmdPath cmd) (cmdExtension cmd)
src/Config/Type.hs view
@@ -108,7 +108,7 @@ = SettingClassify Classify | SettingMatchExp HintRule | SettingRestrict Restrict- | SettingArgument String+ | SettingArgument String -- ^ Extra command-line argument | Builtin String -- use a builtin hint set | Infix Fixity deriving Show
src/HLint.hs view
@@ -128,12 +128,18 @@ runHlintMain args cmd Nothing runHlintMain :: [String] -> Cmd -> Maybe FilePath -> IO [Idea]-runHlintMain args cmd@CmdMain{..} fp = do- files <- concatMapM (resolveFile cmd fp) cmdFiles- if null files- then error "No files found"- else runHints args cmd{cmdFiles=files}+runHlintMain args cmd tmpFile = do+ (cmd, settings) <- readAllSettings args cmd+ runHints args settings =<< resolveFiles cmd tmpFile +resolveFiles :: Cmd -> Maybe FilePath -> IO Cmd+resolveFiles cmd@CmdMain{..} tmpFile = do+ files <- concatMapM (resolveFile cmd tmpFile) cmdFiles+ if null files+ then error "No files found"+ else pure cmd { cmdFiles = files }+resolveFiles cmd _ = pure cmd+ readAllSettings :: [String] -> Cmd -> IO (Cmd, [Setting]) readAllSettings args1 cmd@CmdMain{..} = do files <- cmdHintFiles cmd@@ -144,10 +150,8 @@ settings3 <- return [SettingClassify $ Classify Ignore x "" "" | x <- cmdIgnore] return (cmd, settings1 ++ settings2 ++ settings3) --runHints :: [String] -> Cmd -> IO [Idea]-runHints args cmd@CmdMain{..} = do- (cmd@CmdMain{..}, settings) <- readAllSettings args cmd+runHints :: [String] -> [Setting] -> Cmd -> IO [Idea]+runHints args settings cmd@CmdMain{..} = do j <- if cmdThreads == 0 then getNumProcessors else return cmdThreads withNumCapabilities j $ do let outStrLn = whenNormal . putStrLn