hlint 1.8.19 → 1.8.20
raw patch · 3 files changed
+18/−11 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- hlint.cabal +1/−1
- src/Hint/Lambda.hs +2/−2
- src/Test.hs +15/−8
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: hlint-version: 1.8.19+version: 1.8.20 -- license is GPL v2 only license: GPL license-file: LICENSE
src/Hint/Lambda.hs view
@@ -75,11 +75,11 @@ lambdaDecl :: Decl_ -> [Idea]-lambdaDecl (toFunBind -> o@(FunBind _ [Match _ name pats (UnGuardedRhs _ bod) bind]))+lambdaDecl (toFunBind -> o@(FunBind loc [Match _ name pats (UnGuardedRhs _ bod) bind])) | isNothing bind, isLambda $ fromParen bod = [err "Redundant lambda" o $ uncurry reform $ fromLambda $ Lambda an pats bod] | (pats2,bod2) <- etaReduce pats bod, length pats2 < length pats, pvars (drop (length pats2) pats) `disjoint` vars bind = [err "Eta reduce" (reform pats bod) (reform pats2 bod2)]- where reform p b = FunBind an [Match an name p (UnGuardedRhs an b) Nothing]+ where reform p b = FunBind loc [Match an name p (UnGuardedRhs an b) Nothing] lambdaDecl _ = []
src/Test.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE PatternGuards, ScopedTypeVariables #-}+{-# LANGUAGE PatternGuards, ScopedTypeVariables, RecordWildCards #-} module Test(test) where @@ -145,13 +145,20 @@ length (show ideas) >= 0 && -- force, mainly for hpc not (isParseError (head ideas)) && match x (head ideas)- return [failed $- ["TEST FAILURE (" ++ show (length ideas) ++ " hints generated)"- ,"SRC: " ++ showSrcLoc loc- ,"INPUT: " ++ inp] ++- map ((++) "OUTPUT: " . show) ideas ++- ["WANTED: " ++ fromMaybe "<failure>" out]- | not good]+ return $+ [failed $+ ["TEST FAILURE (" ++ show (length ideas) ++ " hints generated)"+ ,"SRC: " ++ showSrcLoc loc+ ,"INPUT: " ++ inp] +++ map ((++) "OUTPUT: " . show) ideas +++ ["WANTED: " ++ fromMaybe "<failure>" out]+ | not good] +++ [failed $+ ["TEST FAILURE (BAD LOCATION)"+ ,"SRC: " ++ showSrcLoc loc+ ,"INPUT: " ++ inp+ ,"OUTPUT: " ++ show i]+ | i@Idea{loc=SrcLoc{..}} <- ideas, srcFilename == "" || srcLine == 0 || srcColumn == 0] match "???" _ = True match x y | "@" `isPrefixOf` x = a == show (severity y) && match (ltrim b) y