hlint 1.9.20 → 1.9.21
raw patch · 5 files changed
+12/−4 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +4/−0
- data/Default.hs +2/−0
- hlint.cabal +1/−1
- src/CmdLine.hs +4/−3
- src/HSE/All.hs +1/−0
CHANGES.txt view
@@ -1,5 +1,9 @@ Changelog for HLint +1.9.21+ #130, ignore a BOM if it exists+ #128, don't find files starting with . when searching directories+ Suggest concat even if the [] is written "" 1.9.20 #122, fix the zipWith/repeat hint 1.9.19
data/Default.hs view
@@ -108,7 +108,9 @@ -- error = take (length x - 1) x ==> init x -- not true for x == [] error = isPrefixOf (reverse x) (reverse y) ==> isSuffixOf x y error = foldr (++) [] ==> concat+error = foldr (++) "" ==> concat error = foldl (++) [] ==> concat where note = IncreasesLaziness+error = foldl (++) "" ==> concat where note = IncreasesLaziness error = foldl f (head x) (tail x) ==> foldl1 f x error = foldr f (last x) (init x) ==> foldr1 f x error = span (not . p) ==> break p
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: hlint-version: 1.9.20+version: 1.9.21 license: BSD3 license-file: LICENSE category: Development
src/CmdLine.hs view
@@ -210,9 +210,10 @@ getFile (p:ath) exts file = do isDir <- doesDirectoryExist $ p <\> file if isDir then do- let avoid x = let y = takeFileName x in "_" `isPrefixOf` y || ("." `isPrefixOf` y && not (all (== '.') y))- xs <- listFilesInside (return . not . avoid) $ p <\> file- return [x | x <- xs, drop 1 (takeExtension x) `elem` exts]+ let avoidDir x = let y = takeFileName x in "_" `isPrefixOf` y || ("." `isPrefixOf` y && not (all (== '.') y))+ avoidFile x = let y = takeFileName x in "." `isPrefixOf` y+ xs <- listFilesInside (return . not . avoidDir) $ p <\> file+ return [x | x <- xs, drop 1 (takeExtension x) `elem` exts, not $ avoidFile x] else do isFil <- doesFileExist $ p <\> file if isFil then return [p <\> file]
src/HSE/All.hs view
@@ -67,6 +67,7 @@ parseModuleEx :: ParseFlags -> FilePath -> Maybe String -> IO (Either ParseError (Module SrcSpanInfo, [Comment])) parseModuleEx flags file str = do str <- maybe (readFileEncoding (encoding flags) file) return str+ str <- return $ fromMaybe str $ stripPrefix "\65279" str -- remove the BOM if it exists, see #130 ppstr <- runCpp (cppFlags flags) file str case parseFileContentsWithComments (mode flags) ppstr of ParseOk (x, cs) -> return $ Right (applyFixity fixity x, cs)