Skip to content

Commit c834706

Browse files
committed
Add separate sets of hard- and soft-enforced linters
1 parent eda5896 commit c834706

File tree

4 files changed

+87
-10
lines changed

4 files changed

+87
-10
lines changed

.github/workflows/lint-soft.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: lint-soft
2+
on:
3+
push:
4+
pull_request:
5+
6+
permissions:
7+
contents: read
8+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
9+
pull-requests: read
10+
11+
jobs:
12+
golangci:
13+
name: lint-soft
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: golangci-lint
18+
uses: golangci/golangci-lint-action@v2
19+
with:
20+
# Optional: golangci-lint command line arguments.
21+
args: --config .golangci-soft.yml --issues-exit-code=0
22+
# Optional: show only new issues if it's a pull request. The default value is `false`.
23+
only-new-issues: true

.github/workflows/lint.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33
push:
44
pull_request:
55

6+
permissions:
7+
contents: read
8+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
9+
pull-requests: read
10+
611
jobs:
712
golangci:
813
name: lint
@@ -13,6 +18,6 @@ jobs:
1318
uses: golangci/golangci-lint-action@v2
1419
with:
1520
# Optional: golangci-lint command line arguments.
16-
args: --issues-exit-code=0
21+
#args:
1722
# Optional: show only new issues if it's a pull request. The default value is `false`.
1823
only-new-issues: true

.golangci-soft.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
run:
2+
tests: false
3+
4+
issues:
5+
include:
6+
- EXC0001
7+
- EXC0005
8+
- EXC0011
9+
- EXC0012
10+
- EXC0013
11+
12+
max-issues-per-linter: 0
13+
max-same-issues: 0
14+
15+
linters:
16+
enable:
17+
# - dupl
18+
- exhaustive
19+
# - exhaustivestruct
20+
- goconst
21+
- godot
22+
- godox
23+
- gomnd
24+
- gomoddirectives
25+
- goprintffuncname
26+
- ifshort
27+
# - lll
28+
- misspell
29+
- nakedret
30+
- nestif
31+
- noctx
32+
- nolintlint
33+
- prealloc
34+
- wrapcheck
35+
36+
# disable default linters, they are already enabled in .golangci.yml
37+
disable:
38+
- deadcode
39+
- errcheck
40+
- gosimple
41+
- govet
42+
- ineffassign
43+
- staticcheck
44+
- structcheck
45+
- typecheck
46+
- unused
47+
- varcheck

.golangci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,28 @@ run:
22
tests: false
33

44
issues:
5+
include:
6+
- EXC0001
7+
- EXC0005
8+
- EXC0011
9+
- EXC0012
10+
- EXC0013
11+
512
max-issues-per-linter: 0
613
max-same-issues: 0
714

815
linters:
916
enable:
1017
- bodyclose
11-
- dupl
1218
- exportloopref
13-
- goconst
14-
- godot
15-
- godox
1619
- goimports
17-
- golint
18-
- goprintffuncname
1920
- gosec
20-
- ifshort
21-
- misspell
22-
- prealloc
21+
- nilerr
22+
- predeclared
23+
- revive
2324
- rowserrcheck
2425
- sqlclosecheck
26+
- tparallel
2527
- unconvert
2628
- unparam
2729
- whitespace

0 commit comments

Comments
 (0)