Skip to content

Commit e8fdb2d

Browse files
committed
Merge branch 'hlint/yaml-lint' of https://github.com/cabalism/stack into cabalism-hlint/yaml-lint
2 parents 3da9393 + c65226b commit e8fdb2d

File tree

7 files changed

+109
-61
lines changed

7 files changed

+109
-61
lines changed

.github/workflows/hlint.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: hlint
2+
3+
# yamllint disable-line rule:truthy
4+
on: [pull_request, push]
5+
6+
jobs:
7+
style:
8+
name: hlint
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Clone project
13+
uses: actions/checkout@v3
14+
15+
- uses: haskell/actions/hlint-setup@v2
16+
name: Set up HLint
17+
with:
18+
version: "3.4"
19+
20+
- name: hlint
21+
run: |
22+
set -ex
23+
hlint src/
24+
hlint src/ --cpp-define=WINDOWS=1
25+
hlint test/ --cpp-simple

.github/workflows/unit-tests.yml

+1-15
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,12 @@ on:
1010
workflow_dispatch:
1111

1212
jobs:
13-
style:
14-
name: Style
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Clone project
18-
uses: actions/checkout@v2
19-
- name: hlint
20-
run: |
21-
set -ex
22-
./etc/scripts/get-hlint.sh
23-
export PATH="$(pwd)"/hlint:$PATH
24-
hlint src/
25-
hlint src/ --cpp-define=WINDOWS=1
26-
hlint test/ --cpp-simple
2713
pedantic:
2814
name: Pedantic
2915
runs-on: ubuntu-latest
3016
steps:
3117
- name: Clone project
32-
uses: actions/checkout@v2
18+
uses: actions/checkout@v3
3319
- name: Cache dependencies
3420
uses: actions/cache@v1
3521
with:

.github/workflows/yamllint.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: yamllint
3+
# yamllint disable-line rule:truthy
4+
on: [pull_request, push]
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: yaml-lint
11+
uses: ibiqlik/action-yamllint@v3
12+
with:
13+
format: github

.hlint.yaml

+54-44
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,6 @@
11
# HLint configuration file
22
# https://github.com/ndmitchell/hlint
33

4-
# Not considered useful hints
5-
- ignore: {name: "Redundant do"}
6-
- ignore: {name: "Use section"}
7-
- ignore: {name: "Use camelCase"}
8-
- ignore: {name: "Use list comprehension"}
9-
- ignore: {name: "Redundant if"}
10-
- ignore: {name: "Avoid lambda"}
11-
- ignore: {name: "Eta reduce"}
12-
- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
13-
- ignore: {name: "Parse error"} # we trust the compiler over HLint
14-
- ignore: {name: "Use =="} # Creates infinite loops in `EQ` using expressions
15-
- ignore: {name: "Evaluate"}
16-
- ignore: {name: "Use &&&"}
17-
- ignore: {name: "Redundant compare"}
18-
- ignore: {name: "Use Just"}
19-
- ignore: {name: "Avoid lambda using `infix`"}
20-
21-
# Added in hlint-2.0.10, ignoring for now
22-
- ignore: {name: "Unnecessary hiding"}
23-
- ignore: {name: "Use lambda-case"}
24-
25-
- ignore: {name: "Use fewer imports", within: [
26-
"System.Process.Read", # Related to 'Hide post-AMP warnings' comment
27-
"Stack.Exec" # ifdef for System.Process.Read
28-
]
29-
}
30-
31-
- ignore: {name: "Use fromMaybe", within: [
32-
"Stack.Types.Config.explicitSetupDeps" # Related to 'explicit pattern matching is clearer' comment
33-
]
34-
}
35-
36-
# For clarity (related to do syntax)
37-
- ignore: {name: "Reduce duplication", within: [
38-
"Network.HTTP.Download.VerifiedSpec",
39-
"Stack.PackageDumpSpec",
40-
"Stack.Types.StackT",
41-
"Stack.Docker"
42-
]
43-
}
44-
454
- error: {lhs: "Network.HTTP.Client.MultipartFormData.formDataBody", rhs: "Network.HTTP.StackClient.formDataBody"}
465
- error: {lhs: "Network.HTTP.Client.MultipartFormData.partBS", rhs: "Network.HTTP.StackClient.partBS"}
476
- error: {lhs: "Network.HTTP.Client.MultipartFormData.partFileRequestBody", rhs: "Network.HTTP.StackClient.partFileRequestBody"}
@@ -83,8 +42,59 @@
8342
- error: {lhs: "Network.HTTP.Types.hContentLength", rhs: "Network.HTTP.StackClient.hContentLength"}
8443
- error: {lhs: "Network.HTTP.Types.hContentMD5", rhs: "Network.HTTP.StackClient.hContentMD5"}
8544
- error: {lhs: "Network.HTTP.Types.methodPut", rhs: "Network.HTTP.StackClient.methodPut"}
86-
- ignore: {name: "Use alternative", within: "Network.HTTP.StackClient"}
45+
46+
# We define the above alternatives but then must ignore these with
47+
# ignore "Use alternative" within Network.HTTP.StackClient.
48+
- ignore:
49+
name: "Use alternative"
50+
within:
51+
- Network.HTTP.StackClient
52+
53+
# Not considered useful hints
54+
- ignore: {name: "Redundant do"}
55+
- ignore: {name: "Use section"}
56+
- ignore: {name: "Use camelCase"}
57+
- ignore: {name: "Use list comprehension"}
58+
- ignore: {name: "Redundant if"}
59+
- ignore: {name: "Avoid lambda"}
60+
- ignore: {name: "Eta reduce"}
61+
- ignore: {name: "Use fmap"} # specific for GHC 7.8 compat
62+
- ignore: {name: "Parse error"} # we trust the compiler over HLint
63+
- ignore: {name: "Use =="} # Creates infinite loops in `EQ` using expressions
64+
- ignore: {name: "Evaluate"}
65+
- ignore: {name: "Use &&&"}
66+
- ignore: {name: "Redundant compare"}
67+
- ignore: {name: "Use Just"}
68+
- ignore: {name: "Avoid lambda using `infix`"}
69+
70+
# Added in hlint-2.0.10, ignoring for now
71+
- ignore: {name: "Unnecessary hiding"}
72+
- ignore: {name: "Use lambda-case"}
73+
74+
- ignore:
75+
name: "Use fewer imports"
76+
within:
77+
- System.Process.Read # Related to 'Hide post-AMP warnings' comment
78+
- Stack.Exec # ifdef for System.Process.Read
79+
80+
# Related to 'explicit pattern matching is clearer' comment
81+
- ignore:
82+
name: "Use fromMaybe"
83+
within:
84+
- Stack.Types.Config.explicitSetupDeps
85+
86+
# For clarity (related to do syntax)
87+
- ignore:
88+
name: "Reduce duplication"
89+
within:
90+
- Network.HTTP.Download.VerifiedSpec
91+
- Stack.PackageDumpSpec
92+
- Stack.Types.StackT
93+
- Stack.Docker
8794

8895
# Gives an incorrect hint that breaks type checking due to mismatched types
89-
- ignore: {name: "Too strict maybe", within: "Stack.Package" }
90-
- ignore: {name: "Too strict maybe", within: "Stack.Config" }
96+
- ignore:
97+
name: "Too strict maybe"
98+
within:
99+
- Stack.Config
100+
- Stack.Package

.yamllint.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: default
2+
rules:
3+
document-start: disable
4+
line-length: disable
5+
indentation:
6+
spaces: 2
7+
indent-sequences: false
8+
9+
ignore: |
10+
.github/workflows/arm64-release.yml
11+
.github/workflows/integration-tests.yml
12+
.github/workflows/unit-tests.yml
13+
doc
14+
test

stack-ghc-923.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ flags:
1919
developer-mode: true
2020

2121
ghc-options:
22-
"$locals": -fhide-source-paths
22+
"$locals": -fhide-source-paths
2323

2424
extra-deps:
2525
# See https://github.com/commercialhaskell/pantry/pull/53

stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ extra-deps:
1111

1212
docker:
1313
enable: false
14-
#repo: fpco/alpine-haskell-stack:8.10.4
14+
# repo: fpco/alpine-haskell-stack:8.10.4
1515
repo: fpco/alpine-haskell-stack@sha256:1024fe4b3b082a8df64d00e8563b3151220ed90af09604a8f7e1d44040500c30
1616

1717
nix:

0 commit comments

Comments
 (0)