Skip to content

Commit 31ae312

Browse files
philderbeastulysses4ever
authored andcommitted
Create default hlint configuration (with tidy up)
* hlint --default -j . > .hlint.yaml * Ignore modules that #include "MachDeps.h" Warning: Can't find file "MachDeps.h" in directories ./cabal-testsuite/PackageTests/CmmSources/src . Asked for by: ./cabal-testsuite/PackageTests/CmmSources/src/Demo.hs at line 8 col 1 Warning: Can't find file "MachDeps.h" in directories ./cabal-testsuite/PackageTests/CmmSourcesDyn/src . Asked for by: ./cabal-testsuite/PackageTests/CmmSourcesDyn/src/Demo.hs at line 8 col 1 * Ignore the manually generated Lexer.hs templates/Lexer.x:10:1-20: Warning: Use fewer LANGUAGE pragmas Found: {-# LANGUAGE CPP #-} {-# LANGUAGE CPP #-} Perhaps: {-# LANGUAGE CPP #-} 1 hint * Ignore templates/Paths_pkg.template.hs for its parse error * Ignore templates/SPDX*.hs for their parse errors * Add a linting workflow and rename the formatting one * Redo default configuration with hlint-3.5 I had mistakenly used a development build before: $ hlint --version HLint v3.6.20230213, (C) Neil Mitchell 2006-2022 * Shorten github workflow
1 parent be2fd1a commit 31ae312

File tree

3 files changed

+124
-1
lines changed

3 files changed

+124
-1
lines changed

.github/workflows/linting.yml renamed to .github/workflows/format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Linting
1+
name: Formatting
22

33
on:
44
pull_request:

.github/workflows/lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Linting
2+
3+
on:
4+
pull_request:
5+
push:
6+
7+
jobs:
8+
hlint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- uses: haskell/actions/hlint-setup@v2
13+
with:
14+
version: "3.5"
15+
- uses: haskell/actions/hlint-run@v2
16+
with:
17+
path: "."
18+
fail-on: suggestion

.hlint.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Warnings currently triggered by your code
2+
- ignore: {name: "Avoid lambda"} # 49 hints
3+
- ignore: {name: "Avoid lambda using `infix`"} # 19 hints
4+
- ignore: {name: "Eta reduce"} # 91 hints
5+
- ignore: {name: "Evaluate"} # 9 hints
6+
- ignore: {name: "Functor law"} # 14 hints
7+
- ignore: {name: "Fuse concatMap/map"} # 3 hints
8+
- ignore: {name: "Fuse foldr/map"} # 3 hints
9+
- ignore: {name: "Fuse mapMaybe/map"} # 2 hints
10+
- ignore: {name: "Fuse traverse_/map"} # 1 hint
11+
- ignore: {name: "Hoist not"} # 30 hints
12+
- ignore: {name: "Missing NOINLINE pragma"} # 1 hint
13+
- ignore: {name: "Monoid law, left identity"} # 3 hints
14+
- ignore: {name: "Monoid law, right identity"} # 3 hints
15+
- ignore: {name: "Move brackets to avoid $"} # 25 hints
16+
- ignore: {name: "Move guards forward"} # 4 hints
17+
- ignore: {name: "Redundant $"} # 125 hints
18+
- ignore: {name: "Redundant $!"} # 4 hints
19+
- ignore: {name: "Redundant <$>"} # 6 hints
20+
- ignore: {name: "Redundant =="} # 1 hint
21+
- ignore: {name: "Redundant bracket"} # 206 hints
22+
- ignore: {name: "Redundant guard"} # 2 hints
23+
- ignore: {name: "Redundant if"} # 1 hint
24+
- ignore: {name: "Redundant lambda"} # 22 hints
25+
- ignore: {name: "Redundant list comprehension"} # 3 hints
26+
- ignore: {name: "Redundant map"} # 1 hint
27+
- ignore: {name: "Redundant multi-way if"} # 1 hint
28+
- ignore: {name: "Redundant return"} # 4 hints
29+
- ignore: {name: "Redundant where"} # 3 hints
30+
- ignore: {name: "Replace case with fromMaybe"} # 5 hints
31+
- ignore: {name: "Replace case with maybe"} # 10 hints
32+
- ignore: {name: "Unused LANGUAGE pragma"} # 121 hints
33+
- ignore: {name: "Use $>"} # 5 hints
34+
- ignore: {name: "Use ++"} # 4 hints
35+
- ignore: {name: "Use :"} # 28 hints
36+
- ignore: {name: "Use <$"} # 2 hints
37+
- ignore: {name: "Use <$>"} # 67 hints
38+
- ignore: {name: "Use <&>"} # 14 hints
39+
- ignore: {name: "Use <=<"} # 5 hints
40+
- ignore: {name: "Use =<<"} # 6 hints
41+
- ignore: {name: "Use =="} # 2 hints
42+
- ignore: {name: "Use >=>"} # 3 hints
43+
- ignore: {name: "Use ?~"} # 1 hint
44+
- ignore: {name: "Use Just"} # 2 hints
45+
- ignore: {name: "Use all"} # 8 hints
46+
- ignore: {name: "Use bimap"} # 1 hint
47+
- ignore: {name: "Use camelCase"} # 68 hints
48+
- ignore: {name: "Use catMaybes"} # 3 hints
49+
- ignore: {name: "Use concatMap"} # 1 hint
50+
- ignore: {name: "Use const"} # 38 hints
51+
- ignore: {name: "Use elem"} # 3 hints
52+
- ignore: {name: "Use fewer imports"} # 13 hints
53+
- ignore: {name: "Use first"} # 2 hints
54+
- ignore: {name: "Use fmap"} # 28 hints
55+
- ignore: {name: "Use fold"} # 1 hint
56+
- ignore: {name: "Use for"} # 1 hint
57+
- ignore: {name: "Use forM_"} # 1 hint
58+
- ignore: {name: "Use for_"} # 1 hint
59+
- ignore: {name: "Use fromMaybe"} # 2 hints
60+
- ignore: {name: "Use fromRight"} # 1 hint
61+
- ignore: {name: "Use fst"} # 1 hint
62+
- ignore: {name: "Use if"} # 4 hints
63+
- ignore: {name: "Use infix"} # 19 hints
64+
- ignore: {name: "Use isAsciiLower"} # 2 hints
65+
- ignore: {name: "Use isAsciiUpper"} # 2 hints
66+
- ignore: {name: "Use isDigit"} # 2 hints
67+
- ignore: {name: "Use isJust"} # 2 hints
68+
- ignore: {name: "Use isNothing"} # 3 hints
69+
- ignore: {name: "Use lambda-case"} # 49 hints
70+
- ignore: {name: "Use lefts"} # 1 hint
71+
- ignore: {name: "Use list comprehension"} # 11 hints
72+
- ignore: {name: "Use list literal"} # 3 hints
73+
- ignore: {name: "Use list literal pattern"} # 11 hints
74+
- ignore: {name: "Use map"} # 5 hints
75+
- ignore: {name: "Use map once"} # 6 hints
76+
- ignore: {name: "Use mapMaybe"} # 11 hints
77+
- ignore: {name: "Use max"} # 1 hint
78+
- ignore: {name: "Use maybe"} # 10 hints
79+
- ignore: {name: "Use newtype instead of data"} # 19 hints
80+
- ignore: {name: "Use notElem"} # 11 hints
81+
- ignore: {name: "Use null"} # 3 hints
82+
- ignore: {name: "Use or"} # 1 hint
83+
- ignore: {name: "Use record patterns"} # 16 hints
84+
- ignore: {name: "Use replicateM"} # 1 hint
85+
- ignore: {name: "Use replicateM_"} # 6 hints
86+
- ignore: {name: "Use rights"} # 2 hints
87+
- ignore: {name: "Use second"} # 7 hints
88+
- ignore: {name: "Use section"} # 19 hints
89+
- ignore: {name: "Use sortOn"} # 15 hints
90+
- ignore: {name: "Use traverse"} # 1 hint
91+
- ignore: {name: "Use traverse_"} # 1 hint
92+
- ignore: {name: "Use tuple-section"} # 28 hints
93+
- ignore: {name: "Use typeRep"} # 2 hints
94+
- ignore: {name: "Use unless"} # 17 hints
95+
- ignore: {name: "Use unwords"} # 8 hints
96+
- ignore: {name: "Use void"} # 17 hints
97+
- ignore: {name: "Use when"} # 1 hint
98+
99+
- arguments:
100+
- --ignore-glob=cabal-testsuite/PackageTests/CmmSources/src/Demo.hs
101+
- --ignore-glob=cabal-testsuite/PackageTests/CmmSourcesDyn/src/Demo.hs
102+
- --ignore-glob=Cabal-syntax/src/Distribution/Fields/Lexer.hs
103+
- --ignore-glob=templates/Paths_pkg.template.hs
104+
- --ignore-glob=templates/SPDX.LicenseExceptionId.template.hs
105+
- --ignore-glob=templates/SPDX.LicenseId.template.hs

0 commit comments

Comments
 (0)