Skip to content

Commit 0a216dc

Browse files
authored
Bump hlint action, move options to .hlint.yaml (#4808)
* Use haskell-actions/hlint-* actions * Ignore tutorial with unknown directive ## * Move ignore-glob to .hlint.yaml * Move --with-group=extra to .hlint.yaml * Rerun hlint --default
1 parent fdfddeb commit 0a216dc

File tree

2 files changed

+64
-35
lines changed

2 files changed

+64
-35
lines changed

.github/workflows/hlint.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,11 @@ jobs:
1010
name: "Hlint check run"
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v3
14-
15-
- name: 'Installing'
16-
uses: rwe/actions-hlint-setup@v1
13+
- uses: actions/checkout@v6
14+
- uses: haskell-actions/hlint-setup@v2
1715
with:
18-
version: '3.8'
19-
20-
- name: 'Checking code'
21-
uses: rwe/actions-hlint-run@v2
16+
version: "3.10"
17+
- uses: haskell-actions/hlint-run@v2
2218
with:
23-
hlint-bin: "hlint --with-group=extra --ignore-glob=**/testdata/** --ignore-glob=**/test/data/**"
19+
path: "."
2420
fail-on: error
25-
path: .
26-

.hlint.yaml

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,56 @@
66
# $ hlint --git -j4
77

88
# Warnings currently triggered by our code
9-
- ignore: {name: "Use <$>"}
10-
- ignore: {name: "Use :"}
11-
- ignore: {name: "Redundant do"}
12-
- ignore: {name: "Avoid lambda"}
13-
- ignore: {name: "Use newtype instead of data"}
14-
- ignore: {name: "Use unless"}
15-
- ignore: {name: "Move brackets to avoid $"}
16-
- ignore: {name: "Eta reduce"}
17-
- ignore: {name: "Parse error"}
18-
- ignore: {name: "Reduce duplication"}
19-
- ignore: {name: "Use ++"}
20-
- ignore: {name: "Use $>"}
21-
- ignore: {name: "Use section"}
22-
- ignore: {name: "Use record patterns"}
23-
- ignore: {name: "Use camelCase"}
24-
- ignore: {name: "Use uncurry"}
25-
- ignore: {name: "Avoid lambda using `infix`"}
26-
- ignore: {name: "Replace case with fromMaybe"}
9+
- ignore: {name: "Avoid NonEmpty.unzip"} # 2 hints
10+
- ignore: {name: "Avoid lambda"} # 14 hints
11+
- ignore: {name: "Avoid lambda using `infix`"} # 6 hints
12+
- ignore: {name: "Eta reduce"} # 63 hints
13+
- ignore: {name: "Evaluate"} # 1 hint
14+
- ignore: {name: "Functor law"} # 1 hint
15+
- ignore: {name: "Hoist not"} # 2 hints
16+
- ignore: {name: "Move brackets to avoid $"} # 30 hints
17+
- ignore: {name: "Parse error: on input `)'"} # 1 hint
18+
- ignore: {name: "Redundant $"} # 8 hints
19+
- ignore: {name: "Redundant <$>"} # 2 hints
20+
- ignore: {name: "Redundant bracket"} # 12 hints
21+
- ignore: {name: "Redundant guard"} # 1 hint
22+
- ignore: {name: "Redundant lambda"} # 2 hints
23+
- ignore: {name: "Redundant seq"} # 1 hint
24+
- ignore: {name: "Replace case with fromMaybe"} # 1 hint
25+
- ignore: {name: "Replace case with maybe"} # 5 hints
26+
- ignore: {name: "Unused LANGUAGE pragma"} # 14 hints
27+
- ignore: {name: "Use :"} # 9 hints
28+
- ignore: {name: "Use <$>"} # 29 hints
29+
- ignore: {name: "Use ?~"} # 3 hints
30+
- ignore: {name: "Use atomicModifyIORef'_"} # 3 hints
31+
- ignore: {name: "Use camelCase"} # 35 hints
32+
- ignore: {name: "Use concatForM"} # 2 hints
33+
- ignore: {name: "Use concatMap"} # 1 hint
34+
- ignore: {name: "Use const"} # 2 hints
35+
- ignore: {name: "Use curry"} # 1 hint
36+
- ignore: {name: "Use drop1"} # 4 hints
37+
- ignore: {name: "Use dropPrefix"} # 1 hint
38+
- ignore: {name: "Use enumerate"} # 1 hint
39+
- ignore: {name: "Use fewer imports"} # 15 hints
40+
- ignore: {name: "Use fmap"} # 1 hint
41+
- ignore: {name: "Use for_"} # 1 hint
42+
- ignore: {name: "Use guards"} # 1 hint
43+
- ignore: {name: "Use head"} # 1 hint
44+
- ignore: {name: "Use lambda-case"} # 1 hint
45+
- ignore: {name: "Use lower"} # 1 hint
46+
- ignore: {name: "Use newtype instead of data"} # 13 hints
47+
- ignore: {name: "Use record patterns"} # 3 hints
48+
- ignore: {name: "Use section"} # 7 hints
49+
- ignore: {name: "Use traverse_"} # 3 hints
50+
- ignore: {name: "Use uncurry"} # 1 hint
51+
- ignore: {name: "Use unless"} # 4 hints
52+
- ignore: {name: "Use whenJust"} # 1 hint
53+
- ignore: {name: "Use whenMaybe"} # 1 hint
2754

2855
# Gives at least one suggestion we don't like.
29-
- ignore: {name: "Use <=<"}
30-
- ignore: {name: "Use zipFrom"}
31-
- ignore: {name: "Use zipWithFrom"}
56+
- ignore: {name: "Use <=<"} # 2 hints
57+
- ignore: {name: "Use zipFrom"} # 4 hints
58+
- ignore: {name: "Use zipWithFrom"} # 2 hints
3259

3360
# We are using the "redundant" return/pure to assign a name. We do not want to
3461
# delete it. In particular, this is not an improvement:
@@ -37,11 +64,11 @@
3764
# pure options
3865
# Perhaps:
3966
# do somethingComplicated
40-
- ignore: {name: "Redundant return"}
41-
- ignore: {name: "Redundant pure"}
67+
- ignore: {name: "Redundant pure"} # 10 hints
68+
- ignore: {name: "Redundant return"} # 3 hints
4269

4370
# Off by default hints we like
44-
- warn: {name: Use module export list}
71+
- warn: {name: "Use module export list"} # 86 hints
4572

4673
# Condemn nub and friends
4774
- warn: {lhs: nub (sort x), rhs: Data.List.Extra.nubSort x}
@@ -236,3 +263,11 @@
236263
# We really do not want novel usages of restricted functions, and mere
237264
# Warning is not enough to prevent those consistently; you need a build failure.
238265
- error: {name: Avoid restricted function}
266+
267+
- group: {name: extra, enabled: true}
268+
269+
- arguments:
270+
- --ignore-glob=**/test/data/**
271+
- --ignore-glob=**/testdata/**
272+
- --ignore-glob=dist-*
273+
- --ignore-glob=docs/contributing/plugin-tutorial.lhs

0 commit comments

Comments
 (0)