Skip to content

Commit 0f92968

Browse files
authored
Merge pull request #1027 from haskell/hlint-job
Resurrect hlint job
2 parents c8468f3 + 3c64d5c commit 0f92968

File tree

13 files changed

+55
-27
lines changed

13 files changed

+55
-27
lines changed

.github/workflows/haskell-ci.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#
99
# For more information, see https://github.com/haskell-CI/haskell-ci
1010
#
11-
# version: 0.16.3
11+
# version: 0.16.4
1212
#
13-
# REGENDATA ("0.16.3",["github","cabal.project"])
13+
# REGENDATA ("0.16.4",["github","cabal.project"])
1414
#
1515
name: Haskell-CI
1616
on:
@@ -32,19 +32,19 @@ jobs:
3232
strategy:
3333
matrix:
3434
include:
35-
- compiler: ghc-9.6.1
35+
- compiler: ghc-9.6.2
3636
compilerKind: ghc
37-
compilerVersion: 9.6.1
37+
compilerVersion: 9.6.2
3838
setup-method: ghcup
3939
allow-failure: false
40-
- compiler: ghc-9.4.4
40+
- compiler: ghc-9.4.5
4141
compilerKind: ghc
42-
compilerVersion: 9.4.4
42+
compilerVersion: 9.4.5
4343
setup-method: ghcup
4444
allow-failure: false
45-
- compiler: ghc-9.2.7
45+
- compiler: ghc-9.2.8
4646
compilerKind: ghc
47-
compilerVersion: 9.2.7
47+
compilerVersion: 9.2.8
4848
setup-method: ghcup
4949
allow-failure: false
5050
- compiler: ghc-9.0.2
@@ -172,7 +172,7 @@ jobs:
172172
- name: cache (tools)
173173
uses: actions/cache/restore@v3
174174
with:
175-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-a3d9d05c
175+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-cb947dfc
176176
path: ~/.haskell-ci-tools
177177
- name: install cabal-plan
178178
run: |
@@ -192,11 +192,17 @@ jobs:
192192
rm -f cabal-docspec.xz
193193
chmod a+x $HOME/.cabal/bin/cabal-docspec
194194
cabal-docspec --version
195+
- name: install hlint
196+
run: |
197+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then HLINTVER=$(cd /tmp && (${CABAL} v2-install -v $ARG_COMPILER --dry-run hlint --constraint='hlint >=3.5 && <3.6' | perl -ne 'if (/\bhlint-(\d+(\.\d+)*)\b/) { print "$1"; last; }')); echo "HLint version $HLINTVER" ; fi
198+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then if [ ! -e $HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint ]; then echo "Downloading HLint version $HLINTVER"; mkdir -p $HOME/.haskell-ci-tools; curl --write-out 'Status Code: %{http_code} Redirects: %{num_redirects} Total time: %{time_total} Total Dsize: %{size_download}\n' --silent --location --output $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz "https://github.com/ndmitchell/hlint/releases/download/v$HLINTVER/hlint-$HLINTVER-x86_64-linux.tar.gz"; tar -xzv -f $HOME/.haskell-ci-tools/hlint-$HLINTVER.tar.gz -C $HOME/.haskell-ci-tools; fi ; fi
199+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then mkdir -p $CABAL_DIR/bin && ln -sf "$HOME/.haskell-ci-tools/hlint-$HLINTVER/hlint" $CABAL_DIR/bin/hlint ; fi
200+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then hlint --version ; fi
195201
- name: save cache (tools)
196202
uses: actions/cache/save@v3
197203
if: always()
198204
with:
199-
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-a3d9d05c
205+
key: ${{ runner.os }}-${{ matrix.compiler }}-tools-cb947dfc
200206
path: ~/.haskell-ci-tools
201207
- name: checkout
202208
uses: actions/checkout@v3
@@ -272,6 +278,13 @@ jobs:
272278
run: |
273279
$CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all
274280
cabal-docspec $ARG_COMPILER
281+
- name: hlint
282+
run: |
283+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src attoparsec-iso8601/src src-pure src-ffi) ; fi
284+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_attoparsec_iso8601} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src) ; fi
285+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson_examples} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 src/) ; fi
286+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson_benchmarks} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 .) ; fi
287+
if [ $((HCNUMVER >= 90200 && HCNUMVER < 90400)) -ne 0 ] ; then (cd ${PKGDIR_aeson_benchmarks} && hlint -h ${GITHUB_WORKSPACE}/source/.hlint.yaml -XHaskell2010 bench examples/src) ; fi
275288
- name: haddock
276289
run: |
277290
if [ $((HCNUMVER >= 80600)) -ne 0 ] ; then $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all ; fi

.hlint.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,20 @@
1919
name: "Use fewer imports"
2020
within:
2121
- Data.Aeson.Types.Internal
22+
- ignore:
23+
name: "Unused LANGUAGE pragma"
24+
within:
25+
- Data.Aeson.Internal.Text
26+
- Compare.JsonBench
27+
28+
- ignore: { name: "Use fewer imports" }
29+
- ignore: { name: "Use lambda-case" }
30+
- ignore: { name: "Use camelCase" }
31+
- ignore: { name: "Redundant multi-way if" }
32+
33+
- ignore: { name: "Use <$>" }
34+
- ignore: { name: "Use fmap" }
35+
- ignore: { name: "Use curry" }
36+
- ignore: { name: "Use const" }
37+
- ignore: { name: "Use -" }
38+
- ignore: { name: "Use /=" }

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
lint:
2-
./run-hlint.sh --cpp-include include/ --cpp-file travis/cabal_macros.h Data/ attoparsec-iso8601/ benchmarks/ examples/ ffi/ pure/ tests/
2+
./run-hlint.sh --cpp-include include/ src/ attoparsec-iso8601/ benchmarks/ examples/ src-pure/ tests/

aeson.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ tested-with:
1818
|| ==8.8.4
1919
|| ==8.10.7
2020
|| ==9.0.2
21-
|| ==9.2.7
22-
|| ==9.4.4
23-
|| ==9.6.1
21+
|| ==9.2.8
22+
|| ==9.4.5
23+
|| ==9.6.2
2424

2525
synopsis: Fast JSON parsing and encoding
2626
cabal-version: >=1.10

attoparsec-iso8601/attoparsec-iso8601.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cabal-version: >=1.10
1414
homepage: https://github.com/haskell/aeson
1515
bug-reports: https://github.com/haskell/aeson/issues
1616
build-type: Simple
17-
tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC ==9.2.7, GHC==9.4.4, GHC ==9.6.1
17+
tested-with: GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.4, GHC == 8.10.7, GHC == 9.0.2, GHC ==9.2.8, GHC==9.4.5, GHC ==9.6.2
1818
extra-source-files:
1919
README.md
2020
changelog.md

benchmarks/aeson-benchmarks.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ tested-with:
99
|| ==8.8.4
1010
|| ==8.10.7
1111
|| ==9.0.2
12-
|| ==9.2.7
13-
|| ==9.4.4
14-
|| ==9.6.1
12+
|| ==9.2.8
13+
|| ==9.4.5
14+
|| ==9.6.2
1515

1616
flag tasty-bench
1717
description: Use tasty-bench, otherwise criterion

cabal.haskell-ci

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ install-dependencies: False
99
haddock: >=8.6
1010

1111
hlint: True
12-
hlint-job: 8.8.3
12+
hlint-job: 9.2.8
1313
hlint-yaml: .hlint.yaml
1414

1515
constraint-set cffi

examples/aeson-examples.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ tested-with:
1515
|| ==8.8.4
1616
|| ==8.10.7
1717
|| ==9.0.2
18-
|| ==9.2.7
19-
|| ==9.4.4
20-
|| ==9.6.1
18+
|| ==9.2.8
19+
|| ==9.4.5
20+
|| ==9.6.2
2121

2222
library twitter-generic
2323
default-language: Haskell2010

src/Data/Aeson/Decoding/Tokens.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{-# LANGUAGE DeriveTraversable #-}
21
-- | Token definitions.
32
module Data.Aeson.Decoding.Tokens (
43
-- * Types

src/Data/Aeson/Types/ToJSON.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1476,7 +1476,7 @@ instance ToJSON LT.Text where
14761476
toEncoding = E.lazyText
14771477

14781478
instance ToJSONKey LT.Text where
1479-
toJSONKey = toJSONKeyText (LT.toStrict)
1479+
toJSONKey = toJSONKeyText LT.toStrict
14801480

14811481
-- | @since 2.0.2.0
14821482
instance ToJSON ST.ShortText where

0 commit comments

Comments
 (0)