hlint 3.1.3 → 3.1.4
raw patch · 6 files changed
+22/−9 lines, 6 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +3/−0
- data/hlint.yaml +11/−0
- hlint.cabal +1/−1
- src/Apply.hs +5/−6
- src/CmdLine.hs +1/−1
- src/Config/Haskell.hs +1/−1
CHANGES.txt view
@@ -1,5 +1,8 @@ Changelog for HLint (* = breaking change) +3.1.4, released 2020-05-31+ #1018, stop --cross being quadratic+ #1019, more rules suggesting even/odd 3.1.3, released 2020-05-25 #1016, check scopes of restricted functions 3.1.2, released 2020-05-24
data/hlint.yaml view
@@ -617,6 +617,10 @@ - hint: {lhs: 0 == rem n 2, rhs: even n} - hint: {lhs: rem n 2 /= 0, rhs: odd n} - hint: {lhs: 0 /= rem n 2, rhs: odd n}+ - hint: {lhs: mod n 2 == 0, rhs: even n}+ - hint: {lhs: 0 == mod n 2, rhs: even n}+ - hint: {lhs: mod n 2 /= 0, rhs: odd n}+ - hint: {lhs: 0 /= mod n 2, rhs: odd n} - hint: {lhs: not (even x), rhs: odd x} - hint: {lhs: not (odd x), rhs: even x} - hint: {lhs: x ** 0.5, rhs: sqrt x}@@ -964,6 +968,12 @@ - warn: {lhs: "pictures [ p, q ]", rhs: p & q, name: Evaluate} - hint: {lhs: foldl1 (&), rhs: pictures} - hint: {lhs: foldr (&) blank, rhs: pictures}+ - hint: {lhs: scaled x x, rhs: dilated x}+ - hint: {lhs: scaledPoint x x, rhs: dilatedPoint x}+ - warn: {lhs: "brighter (- a)", rhs: "duller a"}+ - warn: {lhs: "lighter (- a)", rhs: "darker a"}+ - warn: {lhs: "duller (- a)", rhs: "brighter a"}+ - warn: {lhs: "darker (- a)", rhs: "lighter a"} - group: name: teaching@@ -975,6 +985,7 @@ - hint: {lhs: "[] /= x", rhs: not (null x), name: Use null} - hint: {lhs: "not (x || y)", rhs: "not x && not y", name: Apply De Morgan law} - hint: {lhs: "not (x && y)", rhs: "not x || not y", name: Apply De Morgan law}+ - hint: {lhs: "[ f x | x <- l ]", rhs: map f l} # <TEST> # yes = concat . map f -- concatMap f
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hlint-version: 3.1.3+version: 3.1.4 license: BSD3 license-file: LICENSE category: Development
src/Apply.hs view
@@ -50,20 +50,19 @@ applyHintsReal :: [Setting] -> Hint -> [ModuleEx] -> [Idea] applyHintsReal settings hints_ ms = concat $ [ map (classify classifiers . removeRequiresExtensionNotes m) $- order [] (hintModule hints settings nm' m) `merge`+ order [] (hintModule hints settings nm m) `merge` concat [order (maybeToList $ declName d) $ decHints d | d <- hsmodDecls $ GHC.unLoc $ ghcModule m]- | m <- ms+ | (nm,m) <- mns , let classifiers = cls ++ mapMaybe readPragma (universeBi (ghcModule m)) ++ concatMap readComment (ghcComments m) , seq (length classifiers) True -- to force any errors from readPragma or readComment- , (nm',m') <- mns'- , let decHints = hintDecl hints settings nm' m' -- partially apply+ , let decHints = hintDecl hints settings nm m -- partially apply , let order n = map (\i -> i{ideaModule = f $ modName (ghcModule m) : ideaModule i, ideaDecl = f $ n ++ ideaDecl i}) . sortOn ideaSpan , let merge = mergeBy (comparing ideaSpan)] ++- [map (classify cls) (hintModules hints settings mns')]+ [map (classify cls) (hintModules hints settings mns)] where f = nubOrd . filter (/= "") cls = [x | SettingClassify x <- settings]- mns' = map (\x -> (scopeCreate (GHC.unLoc $ ghcModule x), x)) ms+ mns = map (\x -> (scopeCreate (GHC.unLoc $ ghcModule x), x)) ms hints = (if length ms <= 1 then noModules else id) hints_ noModules h = h{hintModules = \_ _ -> []} `mappend` mempty{hintModule = \s a b -> hintModules h s [(a,b)]}
src/CmdLine.hs view
@@ -24,7 +24,7 @@ import System.Console.CmdArgs.Explicit(helpText, HelpFormat(..)) import System.Console.CmdArgs.Implicit import System.Directory.Extra-import System.Environment.Extra+import System.Environment import System.Exit import System.FilePath import System.IO
src/Config/Haskell.hs view
@@ -6,7 +6,7 @@ import Data.Char import Data.List.Extra-import Text.Read.Extra(readMaybe)+import Text.Read import Data.Tuple.Extra import Data.Maybe import Config.Type