Add separate sets of hard- and soft-enforced linters
Christian Muehlhaeuser
2 years ago
|
0 |
name: lint-soft
|
|
1 |
on:
|
|
2 |
push:
|
|
3 |
pull_request:
|
|
4 |
|
|
5 |
permissions:
|
|
6 |
contents: read
|
|
7 |
# Optional: allow read access to pull request. Use with `only-new-issues` option.
|
|
8 |
pull-requests: read
|
|
9 |
|
|
10 |
jobs:
|
|
11 |
golangci:
|
|
12 |
name: lint-soft
|
|
13 |
runs-on: ubuntu-latest
|
|
14 |
steps:
|
|
15 |
- uses: actions/checkout@v2
|
|
16 |
- name: golangci-lint
|
|
17 |
uses: golangci/golangci-lint-action@v2
|
|
18 |
with:
|
|
19 |
# Optional: golangci-lint command line arguments.
|
|
20 |
args: --config .golangci-soft.yml --issues-exit-code=0
|
|
21 |
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
|
22 |
only-new-issues: true
|
1 | 1 |
on:
|
2 | 2 |
push:
|
3 | 3 |
pull_request:
|
|
4 |
|
|
5 |
permissions:
|
|
6 |
contents: read
|
|
7 |
# Optional: allow read access to pull request. Use with `only-new-issues` option.
|
|
8 |
pull-requests: read
|
4 | 9 |
|
5 | 10 |
jobs:
|
6 | 11 |
golangci:
|
|
11 | 16 |
- name: golangci-lint
|
12 | 17 |
uses: golangci/golangci-lint-action@v2
|
13 | 18 |
with:
|
14 | |
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
|
15 | |
version: v1.31
|
16 | 19 |
# Optional: golangci-lint command line arguments.
|
17 | |
args: --issues-exit-code=0
|
18 | |
# Optional: working directory, useful for monorepos
|
19 | |
# working-directory: somedir
|
|
20 |
#args:
|
20 | 21 |
# Optional: show only new issues if it's a pull request. The default value is `false`.
|
21 | 22 |
only-new-issues: true
|
|
0 |
run:
|
|
1 |
tests: false
|
|
2 |
|
|
3 |
issues:
|
|
4 |
include:
|
|
5 |
- EXC0001
|
|
6 |
- EXC0005
|
|
7 |
- EXC0011
|
|
8 |
- EXC0012
|
|
9 |
- EXC0013
|
|
10 |
|
|
11 |
max-issues-per-linter: 0
|
|
12 |
max-same-issues: 0
|
|
13 |
|
|
14 |
linters:
|
|
15 |
enable:
|
|
16 |
# - dupl
|
|
17 |
- exhaustive
|
|
18 |
# - exhaustivestruct
|
|
19 |
- goconst
|
|
20 |
- godot
|
|
21 |
- godox
|
|
22 |
- gomnd
|
|
23 |
- gomoddirectives
|
|
24 |
- goprintffuncname
|
|
25 |
- ifshort
|
|
26 |
# - lll
|
|
27 |
- misspell
|
|
28 |
- nakedret
|
|
29 |
- nestif
|
|
30 |
- noctx
|
|
31 |
- nolintlint
|
|
32 |
- prealloc
|
|
33 |
- wrapcheck
|
|
34 |
|
|
35 |
# disable default linters, they are already enabled in .golangci.yml
|
|
36 |
disable:
|
|
37 |
- deadcode
|
|
38 |
- errcheck
|
|
39 |
- gosimple
|
|
40 |
- govet
|
|
41 |
- ineffassign
|
|
42 |
- staticcheck
|
|
43 |
- structcheck
|
|
44 |
- typecheck
|
|
45 |
- unused
|
|
46 |
- varcheck
|
1 | 1 |
tests: false
|
2 | 2 |
|
3 | 3 |
issues:
|
|
4 |
include:
|
|
5 |
- EXC0001
|
|
6 |
- EXC0005
|
|
7 |
- EXC0011
|
|
8 |
- EXC0012
|
|
9 |
- EXC0013
|
|
10 |
|
4 | 11 |
max-issues-per-linter: 0
|
5 | 12 |
max-same-issues: 0
|
6 | 13 |
|
7 | 14 |
linters:
|
8 | 15 |
enable:
|
9 | 16 |
- bodyclose
|
10 | |
- dupl
|
11 | 17 |
- exportloopref
|
12 | |
- goconst
|
13 | |
- godot
|
14 | |
- godox
|
15 | 18 |
- goimports
|
16 | |
- goprintffuncname
|
17 | 19 |
- gosec
|
18 | |
- misspell
|
19 | |
- prealloc
|
|
20 |
- nilerr
|
|
21 |
- predeclared
|
|
22 |
- revive
|
20 | 23 |
- rowserrcheck
|
21 | 24 |
- sqlclosecheck
|
|
25 |
- tparallel
|
22 | 26 |
- unconvert
|
23 | 27 |
- unparam
|
24 | 28 |
- whitespace
|