hlint 2.1.8 → 2.1.9
raw patch · 4 files changed
+19/−2 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.txt +3/−0
- hlint.cabal +1/−1
- src/HSE/All.hs +5/−1
- src/Hint/Extensions.hs +10/−0
CHANGES.txt view
@@ -1,5 +1,8 @@ Changelog for HLint (* = breaking change) +2.1.9, released 2018-08-08+ Add QuickCheck fixities+ Warn on redundant EmptyCase extension 2.1.8, released 2018-07-06 #509, remove incorrect suggestions around sequence/pure 2.1.7, released 2018-07-03
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.18 build-type: Simple name: hlint-version: 2.1.8+version: 2.1.9 license: BSD3 license-file: LICENSE category: Development
src/HSE/All.hs view
@@ -81,6 +81,10 @@ infix_ 1 ["`shouldBe`","`shouldSatisfy`","`shouldStartWith`","`shouldEndWith`","`shouldContain`","`shouldMatchList`" ,"`shouldReturn`","`shouldNotBe`","`shouldNotSatisfy`","`shouldNotContain`","`shouldNotReturn`","`shouldThrow`"] +quickCheckFixities :: [Fixity]+quickCheckFixities =+ infixr_ 0 ["==>"] +++ infix_ 4 ["==="] -- Fixites from the `base` package which are currently -- missing from `haskell-src-exts`'s baseFixities.@@ -103,7 +107,7 @@ -- | Default value for 'ParseFlags'. defaultParseFlags :: ParseFlags defaultParseFlags = ParseFlags NoCpp defaultParseMode- {fixities = Just $ customFixities ++ baseFixities ++ baseNotYetInHSE ++ lensFixities ++ hspecFixities+ {fixities = Just $ customFixities ++ baseFixities ++ baseNotYetInHSE ++ lensFixities ++ hspecFixities ++ quickCheckFixities ,ignoreLinePragmas = False ,ignoreFunctionArity = True ,extensions = defaultExtensions}
src/Hint/Extensions.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE ScopedTypeVariables #-}+ {- Suggest removal of unnecessary extensions i.e. They have {-# LANGUAGE RecursiveDo #-} but no mdo keywords@@ -114,6 +116,10 @@ foo = id -- {-# LANGUAGE GeneralizedNewtypeDeriving #-} \ newtype X = X Int deriving newtype Show+{-# LANGUAGE EmptyCase #-} \+main = case () of {}+{-# LANGUAGE EmptyCase #-} \+main = case () of x -> x -- </TEST> -} @@ -186,6 +192,10 @@ where f (DataDecl _ _ _ _ [] _) = True f (GDataDecl _ _ _ _ _ [] _) = True f _ = False+used EmptyCase = hasS f+ where f (Case _ _ []) = True+ f (LCase _ []) = True+ f (_ :: Exp_) = False used KindSignatures = hasT (un :: Kind S) used BangPatterns = hasS isPBangPat used TemplateHaskell = hasT2 (un :: (Bracket S, Splice S)) ||^ hasS f ||^ hasS isSpliceDecl