packages feed

hlint 1.9.22 → 1.9.23

raw patch · 7 files changed

+14/−8 lines, 7 filesdep ~haskell-src-extsPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: haskell-src-exts

API changes (from Hackage documentation)

Files

CHANGES.txt view
@@ -1,5 +1,8 @@ Changelog for HLint +1.9.23+    #184, require haskell-src-exts-1.17+    #183, allow test_ as a prefix 1.9.22     Don't suggest redundant lambda on view patterns     Add --no-exit-code flag
README.md view
@@ -1,4 +1,5 @@-# HLint [![Hackage version](https://img.shields.io/hackage/v/hlint.svg?style=flat)](https://hackage.haskell.org/package/hlint) [![Build Status](https://img.shields.io/travis/ndmitchell/hlint.svg?style=flat)](https://travis-ci.org/ndmitchell/hlint)+# HLint [![Hackage version](https://img.shields.io/hackage/v/hlint.svg?label=Hackage)](https://hackage.haskell.org/package/hlint) [![Stackage version](https://www.stackage.org/package/hlint/badge/lts?label=Stackage)](https://www.stackage.org/package/hlint) [![Linux Build Status](https://img.shields.io/travis/ndmitchell/hlint.svg?label=Linux%20build)](https://travis-ci.org/ndmitchell/hlint) [![Windows Build Status](https://img.shields.io/appveyor/ci/ndmitchell/hlint.svg?label=Windows%20build)](https://ci.appveyor.com/project/ndmitchell/hlint)+  HLint is a tool for suggesting possible improvements to Haskell code. These suggestions include ideas such as using alternative functions, simplifying code and spotting redundancies. You can try HLint online at [lpaste.net](http://lpaste.net/) - suggestions are shown at the bottom. This document is structured as follows: 
data/Default.hs view
@@ -583,7 +583,7 @@ yes x = case x of {True -> a ; False -> b} -- if x then a else b yes x = case x of {False -> a ; _ -> b} -- if x then b else a no = const . ok . toResponse $ "saved"-yes = case x z of Nothing -> y z; Just pattern -> pattern -- fromMaybe (y z) (x z)+yes = case x z of Nothing -> y z; Just pat -> pat -- fromMaybe (y z) (x z) yes = if p then s else return () -- Control.Monad.when p s error = a $$$$ b $$$$ c ==> a . b $$$$$ c yes = when (not . null $ asdf) -- unless (null asdf)
hlint.cabal view
@@ -1,7 +1,7 @@ cabal-version:      >= 1.6 build-type:         Simple name:               hlint-version:            1.9.22+version:            1.9.23 license:            BSD3 license-file:       LICENSE category:           Development@@ -49,7 +49,7 @@         transformers >= 0.0,         cpphs >= 1.18.1,         cmdargs >= 0.10,-        haskell-src-exts >= 1.16 && < 1.17,+        haskell-src-exts >= 1.17 && < 1.18,         uniplate >= 1.5,         ansi-terminal >= 0.6.2,         extra >= 0.5,
src/HSE/Scope.hs view
@@ -97,8 +97,8 @@             where ms = map g xs          g :: ImportSpec S -> Maybe Bool -- does this import cover the name x-        g (IVar _ _ y) = Just $ x =~= y-        g (IAbs _ y) = Just $ x =~= y+        g (IVar _ y) = Just $ x =~= y+        g (IAbs _ _ y) = Just $ x =~= y         g (IThingAll _ y) = if x =~= y then Just True else Nothing         g (IThingWith _ y ys) = Just $ x `elem_` (y : map fromCName ys) 
src/Hint/Import.hs view
@@ -139,7 +139,7 @@     = [rawIdeaN Warning "Use hierarchical imports" (toSrcSpan $ ann i) (trimStart $ prettyPrint i) (           Just $ unlines $ map (trimStart . prettyPrint)           [f "System.IO" Nothing, f "System.IO.Error" Nothing-          ,f "Control.Exception" $ Just $ ImportSpecList an False [IVar an (NoNamespace an) $ toNamed x | x <- ["bracket","bracket_"]]]) []]+          ,f "Control.Exception" $ Just $ ImportSpecList an False [IVar an $ toNamed x | x <- ["bracket","bracket_"]]]) []]     where f a b = (desugarQual i){importModule=ModuleName an a, importSpecs=b}  hierarchy _ = []
src/Hint/Naming.hs view
@@ -8,6 +8,7 @@     Apply this to things that would get exported by default only     Also allow prop_ as it's a standard QuickCheck idiom     Also allow case_ as it's a standard test-framework-th idiom+    Also allow test_ as it's a standard tasty-th idiom     Also allow numbers separated by _     Also don't suggest anything mentioned elsewhere in the module @@ -24,6 +25,7 @@ semiring'laws = 1 -- semiringLaws = ... data Yes = FOO_A | Foo_B -- data Yes = FOO_A | FooB case_foo = 1+test_foo = 1 cast_foo = 1 -- castFoo = ... replicateM_ = 1 _foo__ = 1@@ -84,7 +86,7 @@ suggestName :: String -> Maybe String suggestName x     | isSym x || good || not (any isLower x) || any isDigit x ||-        any (`isPrefixOf` x) ["prop_","case_"] = Nothing+        any (`isPrefixOf` x) ["prop_","case_","test_"] = Nothing     | otherwise = Just $ f x     where         good = all isAlphaNum $ drp '_' $ drp '#' $ drp '\'' $ reverse $ drp '_' x