Skip to content

Commit 116f43a

Browse files
committed
Enable more Go linters and document exclusions
1 parent 5b7538a commit 116f43a

File tree

20 files changed

+190
-256
lines changed

20 files changed

+190
-256
lines changed

.golangci.bck.yaml

Lines changed: 0 additions & 122 deletions
This file was deleted.

.golangci.next.yaml

Lines changed: 74 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,86 @@
1-
# https://golangci-lint.run/usage/configuration/
1+
# https://golangci-lint.run/usage/configuration
22
#
33
# This file is for linters that might be interesting to enforce in the future.
44
# Rules that should be enforced immediately belong in [.golangci.yaml].
55
#
66
# Both files are used by [.github/workflows/lint.yaml].
7+
version: "2"
78

9+
# https://golangci-lint.run/usage/linters
810
linters:
9-
disable-all: true
10-
enable:
11-
- contextcheck
12-
- err113
13-
- gocritic
14-
- godot
15-
- godox
16-
- gofumpt
17-
- gosec # exclude-use-default
18-
- nilnil
11+
default: all
12+
disable:
13+
- asasalint
14+
- asciicheck
15+
- bidichk
16+
- bodyclose
17+
- copyloopvar
18+
- depguard
19+
- dupword
20+
- durationcheck
21+
- errchkjson
22+
- errname
23+
- errorlint
24+
- exhaustive
25+
- exptostd
26+
- fatcontext
27+
- forbidigo
28+
- ginkgolinter
29+
- gocheckcompilerdirectives
30+
- gochecksumtype
31+
- goheader
32+
- gomoddirectives
33+
- gomodguard
34+
- goprintffuncname
35+
- gosec
36+
- gosmopolitan
37+
- grouper
38+
- iface
39+
- importas
40+
- interfacebloat
41+
- intrange
42+
- loggercheck
43+
- makezero
44+
- mirror
45+
- misspell
46+
- musttag
47+
- nilerr
48+
- nilnesserr
49+
- noctx
1950
- nolintlint
51+
- nosprintfhostport
52+
- prealloc
2053
- predeclared
21-
- revive
22-
- staticcheck # exclude-use-default
23-
- tenv
24-
- thelper
25-
- tparallel
54+
- promlinter
55+
- protogetter
56+
- reassign
57+
- recvcheck
58+
- rowserrcheck
59+
- sloglint
60+
- spancheck
61+
- sqlclosecheck
62+
- tagalign
63+
- testifylint
64+
- unconvert
65+
- unparam
66+
- usestdlibvars
67+
- usetesting
2668
- wastedassign
27-
presets:
28-
- performance
69+
- wsl
70+
- zerologlint
2971

30-
issues:
31-
exclude-rules:
32-
# We call external linters when they are installed: Flake8, ShellCheck, etc.
33-
- linters: [gosec]
34-
path: '_test[.]go$'
35-
text: 'G204: Subprocess launched with variable'
72+
settings:
73+
thelper:
74+
# https://github.com/kulti/thelper/issues/27
75+
tb: { begin: true, first: true }
76+
test: { begin: true, first: true, name: true }
3677

37-
# https://github.com/golangci/golangci-lint/issues/2239
38-
exclude-use-default: false
39-
40-
linters-settings:
41-
thelper:
42-
# https://github.com/kulti/thelper/issues/27
43-
tb: { begin: true, first: true }
44-
test: { begin: true, first: true, name: true }
78+
exclusions:
79+
warn-unused: true
80+
# Ignore built-in exclusions
81+
presets: []
82+
rules:
83+
# We call external linters when they are installed: Flake8, ShellCheck, etc.
84+
- linters: [gosec]
85+
path: '_test[.]go$'
86+
text: 'G204: Subprocess launched with variable'

0 commit comments

Comments
 (0)