Hello community, here is the log from the commit of package hlint for openSUSE:Factory checked in at 2016-03-26 15:22:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hlint (Old) and /work/SRC/openSUSE:Factory/.hlint.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hlint" Changes: -------- --- /work/SRC/openSUSE:Factory/hlint/hlint.changes 2016-02-29 09:16:11.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.hlint.new/hlint.changes 2016-03-26 15:22:36.000000000 +0100 @@ -1,0 +2,6 @@ +Wed Mar 2 10:22:56 UTC 2016 - mimi...@gmail.com + +- update to 1.9.31 +* don't suggest removing ~ if the Strict extension is on + +------------------------------------------------------------------- Old: ---- hlint-1.9.30.tar.gz New: ---- hlint-1.9.31.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hlint.spec ++++++ --- /var/tmp/diff_new_pack.YBLdH1/_old 2016-03-26 15:22:37.000000000 +0100 +++ /var/tmp/diff_new_pack.YBLdH1/_new 2016-03-26 15:22:37.000000000 +0100 @@ -20,7 +20,7 @@ # no useful debuginfo for Haskell packages without C sources %global debug_package %{nil} Name: hlint -Version: 1.9.30 +Version: 1.9.31 Release: 0 Summary: Source code suggestions License: BSD-3-Clause ++++++ hlint-1.9.30.tar.gz -> hlint-1.9.31.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-1.9.30/CHANGES.txt new/hlint-1.9.31/CHANGES.txt --- old/hlint-1.9.30/CHANGES.txt 2016-02-26 21:55:03.000000000 +0100 +++ new/hlint-1.9.31/CHANGES.txt 2016-03-01 15:24:57.000000000 +0100 @@ -1,5 +1,7 @@ Changelog for HLint +1.9.31 + #222, don't suggest removing ~ if the Strict extension is on 1.9.30 #220, fix incorrect hints of foldr/foldl on a tuple accumulator 1.9.29 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-1.9.30/hlint.cabal new/hlint-1.9.31/hlint.cabal --- old/hlint-1.9.30/hlint.cabal 2016-02-26 21:55:03.000000000 +0100 +++ new/hlint-1.9.31/hlint.cabal 2016-03-01 15:24:57.000000000 +0100 @@ -1,7 +1,7 @@ cabal-version: >= 1.8 build-type: Simple name: hlint -version: 1.9.30 +version: 1.9.31 license: BSD3 license-file: LICENSE category: Development @@ -46,7 +46,7 @@ library build-depends: base == 4.*, process, filepath, directory, containers, - transformers >= 0.0, + transformers, cpphs >= 1.18.1, cmdargs >= 0.10, haskell-src-exts >= 1.17 && < 1.18, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-1.9.30/src/Hint/Pattern.hs new/hlint-1.9.31/src/Hint/Pattern.hs --- old/hlint-1.9.30/src/Hint/Pattern.hs 2016-02-26 21:55:03.000000000 +0100 +++ new/hlint-1.9.31/src/Hint/Pattern.hs 2016-03-01 15:24:57.000000000 +0100 @@ -41,6 +41,8 @@ foo = 1 where g (Just !True) = Nothing -- True foo = 1 where Just !True = Nothing foo otherwise = 1 -- _ +foo ~x = y -- x +{-# LANGUAGE Strict #-} foo ~x = y </TEST> -} @@ -58,16 +60,18 @@ patternHint :: DeclHint -patternHint _ _ x = +patternHint _ modu x = concatMap (uncurry hints . swap) (asPattern x) ++ -- PatBind (used in Let and Where) contains lazy-by-default patterns, everything else is strict - concatMap (patHint False) (universeBi [p | PatBind _ p _ _ <- universe x]) ++ - concatMap (patHint True) (universeBi $ transform noPatBind x) ++ + concatMap (patHint strict False) (universeBi [p | PatBind _ p _ _ <- universe x]) ++ + concatMap (patHint strict True) (universeBi $ transform noPatBind x) ++ concatMap expHint (universeBi x) where noPatBind (PatBind a _ b c) = PatBind a (PWildCard a) b c noPatBind x = x + strict = "Strict" `elem` [n | LanguagePragma _ ns <- modulePragmas modu, Ident _ n <- ns] + hints :: (String -> Pattern -> [Refactoring R.SrcSpan] -> Idea) -> Pattern -> [Idea] hints gen (Pattern l rtype pat (UnGuardedRhs d bod) bind) @@ -145,12 +149,14 @@ alt o@(Alt a pat rhs bind) = [(Pattern a R.Match [pat] rhs bind, \msg (Pattern _ _ [pat] rhs bind) rs -> suggest msg o (Alt a pat rhs bind) [])] -patHint :: Bool -> Pat_ -> [Idea] -patHint strict o@(PApp _ name args) | length args >= 3 && all isPWildCard args = +-- First Bool is if Strict is a language extension +-- Second Bool is if this pattern in this context is going to be evaluated strictly +patHint :: Bool -> Bool -> Pat_ -> [Idea] +patHint lang strict o@(PApp _ name args) | length args >= 3 && all isPWildCard args = [suggest "Use record patterns" o (PRec an name []) [Replace R.Pattern (toSS o) [] (prettyPrint $ PRec an name [])] ] -patHint strict o@(PVar _ v) | prettyPrint v == "otherwise" = [warn "Used otherwise as a pattern" o (PWildCard an) []] +patHint lang strict o@(PVar _ v) | prettyPrint v == "otherwise" = [warn "Used otherwise as a pattern" o (PWildCard an) []] -patHint strict o@(PBangPat _ x) | strict, f x = [warn "Redundant bang pattern" o x [r]] +patHint lang strict o@(PBangPat _ x) | strict, f x = [warn "Redundant bang pattern" o x [r]] where f (PParen _ x) = f x f (PAsPat _ _ x) = f x f PLit{} = True @@ -158,14 +164,14 @@ f PInfixApp{} = True f _ = False r = Replace R.Pattern (toSS o) [("x", toSS x)] "x" -patHint strict o@(PIrrPat _ x) | f x = [warn "Redundant irrefutable pattern" o x [r]] +patHint False strict o@(PIrrPat _ x) | f x = [warn "Redundant irrefutable pattern" o x [r]] where f (PParen _ x) = f x f (PAsPat _ _ x) = f x f PWildCard{} = True f PVar{} = True f _ = False r = Replace R.Pattern (toSS o) [("x", toSS x)] "x" -patHint _ _ = [] +patHint _ _ _ = [] expHint :: Exp_ -> [Idea]