From 5553643177fc5b0e1b174ace5ba1d0096c3a6b78 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Thu, 3 Oct 2019 19:00:05 +0100 Subject: [PATCH 1/4] Pin stack version in CI --- .travis.yml | 8 ++++---- .travis/setup.sh | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index dec8dcda..0f33236b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,16 +39,16 @@ jobs: env: MODE=lint - stage: test if: type != pull_request - env: MODE=test RESOLVER=lts-9.0 # GHC 8.0 + env: MODE=test RESOLVER=lts-9.0 STACKVER=1.6.1 # GHC 8.0 - stage: test if: type != pull_request - env: MODE=test RESOLVER=lts-10.0 # GHC 8.2 + env: MODE=test RESOLVER=lts-10.0 STACKVER=1.6.1 # GHC 8.2 - stage: test if: type != pull_request - env: MODE=test RESOLVER=lts-12.0 # GHC 8.4 + env: MODE=test RESOLVER=lts-12.0 STACKVER=1.7.1 # GHC 8.4 - stage: test if: type != pull_request - env: MODE=test RESOLVER=lts-13.3 # GHC 8.6 - .3 because hedgehog and stylish-haskell aren't in .0 + env: MODE=test RESOLVER=lts-13.3 STACKVER=1.9.3 # GHC 8.6 - .3 because hedgehog and stylish-haskell aren't in .0 - stage: test if: type != pull_request env: MODE=test RESOLVER=nightly diff --git a/.travis/setup.sh b/.travis/setup.sh index 2b366d05..1cece564 100644 --- a/.travis/setup.sh +++ b/.travis/setup.sh @@ -8,8 +8,13 @@ stack="stack --no-terminal" mkdir -p ~/.local/bin -curl -L https://www.stackage.org/stack/linux-x86_64 | \ - tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' +if [[ -z "$STACKVER" ]]; then + curl -L https://www.stackage.org/stack/linux-x86_64 | \ + tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' +else + curl -L https://github.com/commercialhaskell/stack/releases/download/v$STACKVER/stack-$STACKVER-linux-x86_64.tar.gz | \ + tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' +fi if [[ -e ".travis/$RESOLVER.yaml" ]]; then mv ".travis/$RESOLVER.yaml" stack.yaml From 47dc671ed461ff9a74285f50c864644458ee1258 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Thu, 3 Oct 2019 20:25:52 +0100 Subject: [PATCH 2/4] Don't warn on unused imports in CI Different imports are needed by different library versions. Adding CPP to conditionally remove an include is over-complicating matters. --- .travis/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/test b/.travis/test index 48e1b8a0..20051430 100755 --- a/.travis/test +++ b/.travis/test @@ -2,7 +2,7 @@ source .travis/setup.sh -$stack build --ghc-options=-Werror +$stack build --ghc-options="-Werror -Wno-unused-imports" cd dejafu-tests $stack exec -- dejafu-tests +RTS -s From 420d1f02b1715c55877332e6fca1fdc367dbcf18 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Fri, 4 Oct 2019 16:23:01 +0100 Subject: [PATCH 3/4] Disable weeder in CI linting It's reporting that every module is unused, which isn't true. The weeder README says this is still the correct way to do things, so I'm not sure what's going on. --- .travis/lint | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/lint b/.travis/lint index 5ddd6bf2..d18f9a55 100755 --- a/.travis/lint +++ b/.travis/lint @@ -6,7 +6,7 @@ $stack install stylish-haskell $stack build -curl -sL https://raw.github.com/ndmitchell/weeder/master/misc/travis.sh | sh -s . +#curl -sL https://raw.github.com/ndmitchell/weeder/master/misc/travis.sh | sh -s . curl -sL https://raw.github.com/ndmitchell/hlint/master/misc/travis.sh | sh -s . $stack exec ./style.sh From 290aef7473f12db9c3cff2ce856a344498f59f79 Mon Sep 17 00:00:00 2001 From: Michael Walker Date: Fri, 4 Oct 2019 18:06:40 +0100 Subject: [PATCH 4/4] Add lints for law tests --- .hlint.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.hlint.yaml b/.hlint.yaml index a2649bbf..907994e5 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -41,3 +41,9 @@ - ignore: {name: Reduce duplication, within: Integration.MultiThreaded} - ignore: {name: Reduce duplication, within: Integration.SCT} - ignore: {name: Reduce duplication, within: Integration.SingleThreaded} + +# These are tests of the laws +- ignore: {name: "Use <$>", within: Examples.ClassLaws} +- ignore: {name: "Alternative law, right identity", within: Examples.ClassLaws} +- ignore: {name: "Alternative law, left identity", within: Examples.ClassLaws} +- ignore: {name: "Monoid law, right identity", within: Unit.Properties}