Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package hlint for openSUSE:Factory checked in at 2021-02-16 22:39:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/hlint (Old) and /work/SRC/openSUSE:Factory/.hlint.new.28504 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "hlint" Tue Feb 16 22:39:19 2021 rev:9 rq:870886 version:3.2.7 Changes: -------- --- /work/SRC/openSUSE:Factory/hlint/hlint.changes 2021-01-20 18:25:41.811419165 +0100 +++ /work/SRC/openSUSE:Factory/.hlint.new.28504/hlint.changes 2021-02-16 22:48:50.594575349 +0100 @@ -1,0 +2,9 @@ +Mon Jan 18 09:07:13 UTC 2021 - [email protected] + +- Update hlint to version 3.2.7. + 3.2.7, released 2021-01-16 + #1202, add missing parentheses for Avoid Lambda + #1201, allow matching through the & operator (similar to $) + #1196, fix removed parens with operator sections in some cases + +------------------------------------------------------------------- Old: ---- hlint-3.2.6.tar.gz New: ---- hlint-3.2.7.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ hlint.spec ++++++ --- /var/tmp/diff_new_pack.sRFaRI/_old 2021-02-16 22:48:51.462576027 +0100 +++ /var/tmp/diff_new_pack.sRFaRI/_new 2021-02-16 22:48:51.466576029 +0100 @@ -18,7 +18,7 @@ %global pkg_name hlint Name: %{pkg_name} -Version: 3.2.6 +Version: 3.2.7 Release: 0 Summary: Source code suggestions License: BSD-3-Clause ++++++ hlint-3.2.6.tar.gz -> hlint-3.2.7.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/CHANGES.txt new/hlint-3.2.7/CHANGES.txt --- old/hlint-3.2.6/CHANGES.txt 2020-12-30 21:10:27.000000000 +0100 +++ new/hlint-3.2.7/CHANGES.txt 2021-01-16 17:25:18.000000000 +0100 @@ -1,5 +1,9 @@ Changelog for HLint (* = breaking change) +3.2.7, released 2021-01-16 + #1202, add missing parentheses for Avoid Lambda + #1201, allow matching through the & operator (similar to $) + #1196, fix removed parens with operator sections in some cases 3.2.6, released 2020-12-30 Fixes to the release generation script 3.2.5, released 2020-12-30 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/LICENSE new/hlint-3.2.7/LICENSE --- old/hlint-3.2.6/LICENSE 2020-01-08 10:56:22.000000000 +0100 +++ new/hlint-3.2.7/LICENSE 2021-01-02 12:45:23.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright Neil Mitchell 2006-2020. +Copyright Neil Mitchell 2006-2021. All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/README.md new/hlint-3.2.7/README.md --- old/hlint-3.2.6/README.md 2020-11-24 11:00:47.000000000 +0100 +++ new/hlint-3.2.7/README.md 2021-01-02 12:45:01.000000000 +0100 @@ -397,7 +397,7 @@ Getting started on problems in HLint often means wanting to inspect a GHC parse tree to get a sense of what it looks like (to see how to match on it for example). Given a source program `Foo.hs` (say), you can get GHC to print a textual representation of `Foo`'s AST via the `-ddump-parsed-ast` flag e.g. `ghc -fforce-recomp -ddump-parsed-ast -c Foo.hs`. -When you have an [`HsSyn`](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/hs-syn-type) term in your program, it's quite common to want to print it (e.g. via `Debug.Trace.trace`). Types in `HsSyn` aren't in [`Show`](https://hoogle.haskell.org/?hoogle=Show). Not all types in `HsSyn` are [`Outputable`](https://hoogle.haskell.org/?hoogle=Outputable) but when they are you can call `ppr` to get `SDoc`s. This idiom is common enough that there exists [`unsafePrettyPrint`](https://hackage.haskell.org/package/ghc-lib-parser-ex-8.10.0.16/docs/Language-Haskell-GhclibParserEx-GHC-Utils-Outputable.html#v:unsafePrettyPrint). The function [`showAstData`](https://hoogle.haskell.org/?hoogle=showAstData) can be called on any `HsSyn` term to get output like with the `dump-parsed-ast` flag. The `showAstData` approach is preferable to `ppr` when both choices exist in that two ASTs that differ only in fixity arrangments will render differently with the former. +When you have an [`HsSyn`](https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/hs-syn-type) term in your program, it's quite common to want to print it (e.g. via `Debug.Trace.trace`). Types in `HsSyn` aren't in [`Show`](https://hoogle.haskell.org/?hoogle=Show). Not all types in `HsSyn` are [`Outputable`](https://hoogle.haskell.org/?hoogle=Outputable) but when they are you can call `ppr` to get `SDoc`s. This idiom is common enough that there exists [`unsafePrettyPrint`](https://hackage.haskell.org/package/ghc-lib-parser-ex-8.10.0.16/docs/Language-Haskell-GhclibParserEx-GHC-Utils-Outputable.html#v:unsafePrettyPrint). The function [`showAstData`](https://hoogle.haskell.org/?hoogle=showAstData) can be called on any `HsSyn` term to get output like with the `dump-parsed-ast` flag. The `showAstData` approach is preferable to `ppr` when both choices exist in that two ASTs that differ only in fixity arrangements will render differently with the former. ### Acknowledgements diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/data/hlint.yaml new/hlint-3.2.7/data/hlint.yaml --- old/hlint-3.2.6/data/hlint.yaml 2020-12-30 16:36:11.000000000 +0100 +++ new/hlint-3.2.7/data/hlint.yaml 2021-01-16 17:25:04.000000000 +0100 @@ -1047,6 +1047,7 @@ # yes = f x where f x = concat . map head -- concatMap head # yes = concat . map f . g -- concatMap f . g # yes = concat $ map f x -- concatMap f x +# yes = map f x & concat -- concatMap f x # yes = "test" ++ concatMap (' ':) ["of","this"] -- unwords ("test":["of","this"]) # yes = if f a then True else b -- f a || b # yes = not (a == b) -- a /= b @@ -1201,6 +1202,7 @@ # no = foo $ (,) x $ do {this is a test; and another test} # no = sequence (return x) # no = sequenceA (pure a) +# yes = zipWith func xs ys & sequenceA -- Control.Monad.zipWithM func xs ys # {-# LANGUAGE QuasiQuotes #-}; no = f (\url -> [hamlet|foo @{url}|]) # yes = f ((,) x) -- (x,) # yes = f ((,) (2 + 3)) -- (2 + 3,) @@ -1257,7 +1259,9 @@ # fromList [] -- Data.Map.Strict.empty # test953 = for [] $ \n -> bar n >>= \case {Just n -> pure (); Nothing -> baz n} # f = map (flip (,) "a") "123" -- (,"a") +# test1196 = map (flip (,) (+ 1)) "123" -- (,(+ 1)) # f = map ((,) "a") "123" -- ("a",) +# test1196 = map ((,) (+ 1)) "123" -- ((+ 1),) # test979 = flip Map.traverseWithKey blocks \k v -> lots_of_code_goes_here # infixl 4 <*! \ # test993 = f =<< g <$> x <*! y diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/hlint.cabal new/hlint-3.2.7/hlint.cabal --- old/hlint-3.2.6/hlint.cabal 2020-12-30 21:10:31.000000000 +0100 +++ new/hlint-3.2.7/hlint.cabal 2021-01-16 17:25:26.000000000 +0100 @@ -1,13 +1,13 @@ cabal-version: >= 1.18 build-type: Simple name: hlint -version: 3.2.6 +version: 3.2.7 license: BSD3 license-file: LICENSE category: Development author: Neil Mitchell <[email protected]> maintainer: Neil Mitchell <[email protected]> -copyright: Neil Mitchell 2006-2020 +copyright: Neil Mitchell 2006-2021 synopsis: Source code suggestions description: HLint gives suggestions on how to improve your source code. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/src/CmdLine.hs new/hlint-3.2.7/src/CmdLine.hs --- old/hlint-3.2.6/src/CmdLine.hs 2020-09-13 19:44:09.000000000 +0200 +++ new/hlint-3.2.7/src/CmdLine.hs 2021-01-02 12:45:29.000000000 +0100 @@ -172,7 +172,7 @@ ,"To check all Haskell files in 'src' and generate a report type:" ," hlint src --report"] ] &= program "hlint" &= verbosity - &= summary ("HLint v" ++ showVersion version ++ ", (C) Neil Mitchell 2006-2020") + &= summary ("HLint v" ++ showVersion version ++ ", (C) Neil Mitchell 2006-2021") where nam xs = nam_ xs &= name [head xs] nam_ xs = def &= explicit &= name xs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/src/GHC/Util/HsExpr.hs new/hlint-3.2.7/src/GHC/Util/HsExpr.hs --- old/hlint-3.2.6/src/GHC/Util/HsExpr.hs 2020-11-15 17:08:22.000000000 +0100 +++ new/hlint-3.2.7/src/GHC/Util/HsExpr.hs 2021-01-16 17:25:04.000000000 +0100 @@ -33,6 +33,7 @@ import Data.Generics.Uniplate.DataOnly import Data.List.Extra import Data.Tuple.Extra +import Data.Maybe import Refact (substVars, toSS) import Refact.Types hiding (SrcSpan, Match) @@ -227,6 +228,7 @@ ) where gen = noLoc . HsApp noExtField (strToVar "flip") + . if isAtom op then id else addParen -- We're done factoring, but have no variables left, so we shouldn't make a lambda. -- @\ -> e@ ==> @e@ @@ -306,5 +308,4 @@ _ -> False fromParen1 :: LHsExpr GhcPs -> LHsExpr GhcPs -fromParen1 (L _ (HsPar _ x)) = x -fromParen1 x = x +fromParen1 x = fromMaybe x $ remParen x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/src/GHC/Util/Unify.hs new/hlint-3.2.7/src/GHC/Util/Unify.hs --- old/hlint-3.2.6/src/GHC/Util/Unify.hs 2020-12-15 17:57:34.000000000 +0100 +++ new/hlint-3.2.7/src/GHC/Util/Unify.hs 2021-01-16 17:25:04.000000000 +0100 @@ -26,6 +26,7 @@ import Language.Haskell.GhclibParserEx.GHC.Types.Name.Reader import GHC.Util.HsExpr import GHC.Util.View +import Data.Maybe import FastString isUnifyVar :: String -> Bool @@ -171,6 +172,7 @@ | (L _ (OpApp _ lhs1 op1@(L _ (HsVar _ op1')) rhs1)) <- x = guard (nm op1' op2') >> (, Nothing) <$> liftA2 (<>) (unifyExp' nm False lhs1 lhs2) (unifyExp' nm False rhs1 rhs2) | isDol op2 = unifyExp nm root x $ noLoc (HsApp noExtField lhs2 rhs2) + | isAmp op2 = unifyExp nm root x $ noLoc (HsApp noExtField rhs2 lhs2) | otherwise = unifyExp nm root x $ noLoc (HsApp noExtField (noLoc (HsApp noExtField op2 (addPar lhs2))) (addPar rhs2)) where -- add parens around when desugaring the expression, if necessary @@ -179,6 +181,9 @@ unifyExp nm root x y = (, Nothing) <$> unifyExp' nm root x y +isAmp :: LHsExpr GhcPs -> Bool +isAmp (L _ (HsVar _ x)) = rdrNameStr x == "&" + -- | If we "throw away" the extra than we have no where to put it, and the substitution is wrong noExtra :: Maybe (Subst (LHsExpr GhcPs), Maybe (LHsExpr GhcPs)) -> Maybe (Subst (LHsExpr GhcPs)) noExtra (Just (x, Nothing)) = Just x @@ -197,7 +202,11 @@ -- Brackets are not added when expanding '$' in user code, so tolerate -- them in the match even if they aren't in the user code. -- Also, allow the user to put in more brackets than they strictly need (e.g. with infix). -unifyExp' nm root x y | not root, isPar x || isPar y = unifyExp' nm root (fromParen x) (fromParen y) +unifyExp' nm root x y | not root, isJust x2 || isJust y2 = unifyExp' nm root (fromMaybe x x2) (fromMaybe y y2) + where + -- Make sure we deal with the weird brackets that can't be removed around sections + x2 = remParen x + y2 = remParen y unifyExp' nm root x@(L _ (OpApp _ lhs1 (L _ (HsVar _ (rdrNameStr -> v))) rhs1)) y@(L _ (OpApp _ lhs2 (L _ (HsVar _ op2)) rhs2)) = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/src/GHC/Util/View.hs new/hlint-3.2.7/src/GHC/Util/View.hs --- old/hlint-3.2.6/src/GHC/Util/View.hs 2020-09-12 15:23:46.000000000 +0200 +++ new/hlint-3.2.7/src/GHC/Util/View.hs 2021-01-02 20:40:34.000000000 +0100 @@ -12,10 +12,10 @@ import SrcLoc import BasicTypes import Language.Haskell.GhclibParserEx.GHC.Types.Name.Reader +import GHC.Util.Brackets fromParen :: LHsExpr GhcPs -> LHsExpr GhcPs -fromParen (L _ (HsPar _ x)) = fromParen x -fromParen x = x +fromParen x = maybe x fromParen $ remParen x fromPParen :: LPat GhcPs -> LPat GhcPs fromPParen (L _ (ParPat _ x)) = fromPParen x diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hlint-3.2.6/src/Hint/Lambda.hs new/hlint-3.2.7/src/Hint/Lambda.hs --- old/hlint-3.2.6/src/Hint/Lambda.hs 2020-11-22 23:45:51.000000000 +0100 +++ new/hlint-3.2.7/src/Hint/Lambda.hs 2021-01-16 17:25:04.000000000 +0100 @@ -63,6 +63,7 @@ f = a b (\x -> c x d) -- (`c` d) yes = \x -> a x where -- a yes = \x y -> op y x where -- flip op +yes = \x y -> op z y x where -- flip (op z) f = \y -> nub $ reverse y where -- nub . reverse f = \z -> foo $ bar $ baz z where -- foo . bar . baz f = \z -> foo $ bar x $ baz z where -- foo . bar x . baz
