From e3b42e21e759a274f995f575ff8fbcd9fef067b5 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 6 Aug 2017 19:47:19 +0200 Subject: [PATCH 1/3] Bump to latest LTS and drop explicit extra-deps. --- stack.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/stack.yaml b/stack.yaml index 500eb03bca..6cf09692be 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-8.22 +resolver: lts-9.0 # docker: # enable: true # repo: fpco/stack-full @@ -19,8 +19,4 @@ flags: extra-deps: - Cabal-2.0.0.2 - mintty-0.1.1 -- text-metrics-0.3.0 -- unicode-transforms-0.3.2 -- unliftio-core-0.1.0.0 -- unliftio-0.1.0.0 - bindings-uname-0.1 From 26c9a4d2f10c57ab267f3b03c2f7fdbe6c0e2448 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sat, 19 Aug 2017 16:30:40 +0200 Subject: [PATCH 2/3] Use HLint 2. --- .hlint.yaml | 37 +++++++++++++++++++++++++++++++++++++ .travis.yml | 6 +++--- CONTRIBUTING.md | 9 ++++----- HLint.hs | 37 ------------------------------------- 4 files changed, 44 insertions(+), 45 deletions(-) create mode 100644 .hlint.yaml delete mode 100644 HLint.hs diff --git a/.hlint.yaml b/.hlint.yaml new file mode 100644 index 0000000000..7bbe2ad6a6 --- /dev/null +++ b/.hlint.yaml @@ -0,0 +1,37 @@ +# HLint configuration file +# https://github.com/ndmitchell/hlint + +# Not considered useful hints +- ignore: {name: "Redundant do"} +- ignore: {name: "Use section"} +- ignore: {name: "Use camelCase"} +- ignore: {name: "Use list comprehension"} +- ignore: {name: "Redundant if"} +- ignore: {name: "Avoid lambda"} +- ignore: {name: "Eta reduce"} +- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat +- ignore: {name: "Parse error"} # we trust the compiler over HLint +- ignore: {name: "Use =="} # Creates infinite loops in `EQ` using expressions +- ignore: {name: "Evaluate"} +- ignore: {name: "Use &&&"} +- ignore: {name: "Redundant compare"} + +- ignore: {name: "Use fewer imports", within: [ + "System.Process.Read", # Related to 'Hide post-AMP warnings' comment + "Stack.Exec" # ifdef for System.Process.Read + ] +} + +- ignore: {name: "Use fromMaybe", within: [ + "Stack.Types.Config.explicitSetupDeps" # Related to 'explicit pattern matching is clearer' comment + ] +} + +# For clarity (related to do syntax) +- ignore: {name: "Reduce duplication", within: [ + "Network.HTTP.Download.VerifiedSpec", + "Stack.PackageDumpSpec", + "Stack.Types.StackT", + "Stack.Docker" + ] +} diff --git a/.travis.yml b/.travis.yml index 658391ac95..4ab10b5d19 100644 --- a/.travis.yml +++ b/.travis.yml @@ -120,9 +120,9 @@ script: set -ex case "$BUILD" in style) - hlint src/ --hint=HLint.hs - hlint src/ --cpp-define=WINDOWS=1 --hint=HLint.hs - hlint test/ --cpp-simple --hint=HLint.hs + hlint src/ + hlint src/ --cpp-define=WINDOWS=1 + hlint test/ --cpp-simple stack --system-ghc --no-terminal build --pedantic ;; stack) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c1fb60bbd..d07f6f475d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -64,8 +64,8 @@ quality tool. Note that stack contributors need not dogmatically follow the suggested hints but are encouraged to debate their usefulness. If you find a hint is not useful and detracts from readability, consider marking it in the [configuration -file](https://github.com/commercialhaskell/stack/blob/master/HLint.hs) to -be ignored. Please refer to the [HLint manual](https://github.com/ndmitchell/hlint#ignoring-hints) +file](https://github.com/commercialhaskell/stack/blob/master/.hlint.yaml) to +be ignored. Please refer to the [HLint manual](https://github.com/ndmitchell/hlint#readme) for configuration syntax. Quoting [@mgsloan](https://github.com/commercialhaskell/stack/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Amgsloan): @@ -85,8 +85,7 @@ stack install hlint Once installed, you can check your changes with: ``` -hlint src/ test/ --cpp-simple --hint=HLint.hs +hlint src/ test/ --cpp-simple ``` -Where `--cpp-simple` strips `#` lines and `--hint` explicitly specifies the -configuration file. +Where `--cpp-simple` strips `#` lines. diff --git a/HLint.hs b/HLint.hs deleted file mode 100644 index 23d46f7f57..0000000000 --- a/HLint.hs +++ /dev/null @@ -1,37 +0,0 @@ --- HLint configuration file - -module HLint.HLint where - --- mimic default HLint.hs --- https://github.com/ndmitchell/hlint/blob/master/data/HLint.hs -import "hint" HLint.Default -import "hint" HLint.Builtin.All - -ignore "Use fewer imports" = - System.Process.Read -- Related to 'Hide post-AMP warnings' comment - Stack.Exec -- ifdef for System.Process.Read - --- Related to 'explicit pattern matching is clearer' comment -ignore "Use fromMaybe" = - Stack.Types.Config.explicitSetupDeps - --- For clarity (related to do syntax) -ignore "Reduce duplication" = - Network.HTTP.Download.VerifiedSpec - Stack.PackageDumpSpec - Stack.Types.StackT - Stack.Docker - --- Not considered useful hints -ignore "Redundant do" -ignore "Use section" -ignore "Use camelCase" -ignore "Use list comprehension" -ignore "Redundant if" -ignore "Avoid lambda" -ignore "Eta reduce" -ignore "Use fmap" -- specific to GHC 7.8 compat -ignore "Parse error" -- we trust the compiler over HLint -ignore "Use ==" -- Creates infinite loops in `EQ` using expressions -ignore "Evaluate" -ignore "Use &&&" From c932804d2e33aad3afffdc969357fbbf5ba5d726 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Sun, 6 Aug 2017 20:58:48 +0200 Subject: [PATCH 3/3] Remove unused pragmas. --- src/Stack/Types/Resolver.hs | 2 -- src/test/Stack/GhciSpec.hs | 1 - 2 files changed, 3 deletions(-) diff --git a/src/Stack/Types/Resolver.hs b/src/Stack/Types/Resolver.hs index 0d37a27018..12a615b754 100644 --- a/src/Stack/Types/Resolver.hs +++ b/src/Stack/Types/Resolver.hs @@ -8,10 +8,8 @@ {-# LANGUAGE DeriveTraversable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE DataKinds #-} diff --git a/src/test/Stack/GhciSpec.hs b/src/test/Stack/GhciSpec.hs index 734da567b6..b135d7b446 100644 --- a/src/test/Stack/GhciSpec.hs +++ b/src/test/Stack/GhciSpec.hs @@ -1,5 +1,4 @@ -- {-# LANGUAGE NoImplicitPrelude #-} -{-# LANGUAGE OverloadedStrings #-} -- {-# LANGUAGE QuasiQuotes #-} -- {-# LANGUAGE TemplateHaskell #-}