You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Report about assignment of errors to blank identifier.
33
-
check-blank: true
34
-
# Do not report about not checking of errors in type assertions.
35
-
# This is not as dangerous as skipping error values because an unchecked type assertion just immediately panics.
36
-
# We disable this because it makes a ton of useless noise esp. in test code.
37
-
check-type-assertions: false
38
-
forbidigo:
39
-
analyze-types: true # required for pkg:
40
-
forbid:
41
-
# ioutil package has been deprecated: https://github.com/golang/go/issues/42026
42
-
- ^ioutil\..*$
43
-
# Using http.DefaultServeMux is discouraged because it's a global variable that some packages silently and magically add handlers to (esp. net/http/pprof).
44
-
# Applications wishing to use http.ServeMux should obtain local instances through http.NewServeMux() instead of using the global default instance.
45
-
- ^http\.DefaultServeMux$
46
-
- ^http\.Handle(?:Func)?$
47
-
# Forbid usage of old and archived square/go-jose
48
-
- pkg: ^gopkg\.in/square/go-jose\.v2$
49
-
msg: "gopk.in/square/go-jose is archived and has CVEs. Replace it with gopkg.in/go-jose/go-jose.v2"
50
-
- pkg: ^github.com/coreos/go-oidc$
51
-
msg: "github.com/coreos/go-oidc depends on gopkg.in/square/go-jose which has CVEs. Replace it with github.com/coreos/go-oidc/v3"
52
-
53
-
- pkg: ^github.com/howeyc/gopass$
54
-
msg: "github.com/howeyc/gopass is archived, use golang.org/x/term instead"
# gosec wants us to set a short ReadHeaderTimeout to avoid Slowloris attacks, but doing so would expose us to Keep-Alive race conditions (see https://iximiuz.com/en/posts/reverse-proxy-http-keep-alive-and-502s/)
95
-
- G112
96
-
# created file permissions are restricted by umask if necessary
97
-
- G306
98
-
govet:
99
-
enable-all: true
100
-
disable:
101
-
- fieldalignment
102
-
nolintlint:
103
-
require-specific: true
104
-
stylecheck:
105
-
dot-import-whitelist:
106
-
- github.com/majewsky/gg/option
107
-
- github.com/onsi/ginkgo/v2
108
-
- github.com/onsi/gomega
109
-
usestdlibvars:
110
-
constant-kind: true
111
-
crypto-hash: true
112
-
default-rpc-path: true
113
-
http-method: true
114
-
http-status-code: true
115
-
sql-isolation-level: true
116
-
time-layout: true
117
-
time-month: true
118
-
time-weekday: true
119
-
tls-signature-scheme: true
120
-
usetesting:
121
-
os-temp-dir: true
122
-
whitespace:
123
-
# Enforce newlines (or comments) after multi-line function signatures.
124
-
multi-func: true
125
-
126
35
linters:
127
-
# We use 'disable-all' and enable linters explicitly so that a newer version
128
-
# does not introduce new linters unexpectedly.
129
-
disable-all: true
36
+
# Disable all pre-enabled linters and enable them explicitly so that a newer version does not introduce new linters unexpectedly
37
+
default: none
130
38
enable:
131
39
- bodyclose
132
40
- containedctx
@@ -142,11 +50,8 @@ linters:
142
50
- gocheckcompilerdirectives
143
51
- goconst
144
52
- gocritic
145
-
- gofmt
146
-
- goimports
147
53
- gomoddirectives
148
54
- gosec
149
-
- gosimple
150
55
- govet
151
56
- ineffassign
152
57
- intrange
@@ -160,11 +65,126 @@ linters:
160
65
- rowserrcheck
161
66
- sqlclosecheck
162
67
- staticcheck
163
-
- stylecheck
164
-
- typecheck
165
68
- unconvert
166
69
- unparam
167
70
- unused
168
71
- usestdlibvars
169
72
- usetesting
170
73
- whitespace
74
+
settings:
75
+
errcheck:
76
+
check-type-assertions: false
77
+
# Report about assignment of errors to blank identifier.
78
+
check-blank: true
79
+
# Do not report about not checking of errors in type assertions.
80
+
# This is not as dangerous as skipping error values because an unchecked type assertion just immediately panics.
81
+
# We disable this because it makes a ton of useless noise esp. in test code.
82
+
forbidigo:
83
+
analyze-types: true # required for pkg:
84
+
forbid:
85
+
# ioutil package has been deprecated: https://github.com/golang/go/issues/42026
86
+
- pattern: ^ioutil\..*$
87
+
# Using http.DefaultServeMux is discouraged because it's a global variable that some packages silently and magically add handlers to (esp. net/http/pprof).
88
+
# Applications wishing to use http.ServeMux should obtain local instances through http.NewServeMux() instead of using the global default instance.
89
+
- pattern: ^http\.DefaultServeMux$
90
+
- pattern: ^http\.Handle(?:Func)?$
91
+
- pkg: ^gopkg\.in/square/go-jose\.v2$
92
+
msg: gopk.in/square/go-jose is archived and has CVEs. Replace it with gopkg.in/go-jose/go-jose.v2
93
+
- pkg: ^github.com/coreos/go-oidc$
94
+
msg: github.com/coreos/go-oidc depends on gopkg.in/square/go-jose which has CVEs. Replace it with github.com/coreos/go-oidc/v3
95
+
- pkg: ^github.com/howeyc/gopass$
96
+
msg: github.com/howeyc/gopass is archived, use golang.org/x/term instead
97
+
goconst:
98
+
min-occurrences: 5
99
+
gocritic:
100
+
enabled-checks:
101
+
- boolExprSimplify
102
+
- builtinShadow
103
+
- emptyStringTest
104
+
- evalOrder
105
+
- httpNoBody
106
+
- importShadow
107
+
- initClause
108
+
- methodExprCall
109
+
- paramTypeCombine
110
+
- preferFilepathJoin
111
+
- ptrToRefParam
112
+
- redundantSprint
113
+
- returnAfterHttpError
114
+
- stringConcatSimplify
115
+
- timeExprSimplify
116
+
- truncateCmp
117
+
- typeAssertChain
118
+
- typeUnparen
119
+
- unnamedResult
120
+
- unnecessaryBlock
121
+
- unnecessaryDefer
122
+
- weakCond
123
+
- yodaStyleExpr
124
+
gomoddirectives:
125
+
replace-allow-list:
126
+
# for go-pmtud
127
+
- github.com/mdlayher/arp
128
+
toolchain-forbidden: true
129
+
go-version-pattern: 1\.\d+(\.0)?$
130
+
gosec:
131
+
excludes:
132
+
# gosec wants us to set a short ReadHeaderTimeout to avoid Slowloris attacks, but doing so would expose us to Keep-Alive race conditions (see https://iximiuz.com/en/posts/reverse-proxy-http-keep-alive-and-502s/
133
+
- G112
134
+
# created file permissions are restricted by umask if necessary
135
+
- G306
136
+
govet:
137
+
disable:
138
+
- fieldalignment
139
+
enable-all: true
140
+
nolintlint:
141
+
require-specific: true
142
+
staticcheck:
143
+
dot-import-whitelist:
144
+
- github.com/majewsky/gg/option
145
+
- github.com/onsi/ginkgo/v2
146
+
- github.com/onsi/gomega
147
+
usestdlibvars:
148
+
http-method: true
149
+
http-status-code: true
150
+
time-weekday: true
151
+
time-month: true
152
+
time-layout: true
153
+
crypto-hash: true
154
+
default-rpc-path: true
155
+
sql-isolation-level: true
156
+
tls-signature-scheme: true
157
+
constant-kind: true
158
+
usetesting:
159
+
os-temp-dir: true
160
+
whitespace:
161
+
# Enforce newlines (or comments) after multi-line function signatures.
162
+
multi-func: true
163
+
exclusions:
164
+
generated: lax
165
+
presets:
166
+
- comments
167
+
- common-false-positives
168
+
- legacy
169
+
- std-error-handling
170
+
rules:
171
+
- linters:
172
+
- bodyclose
173
+
path: _test\.go
174
+
# It is idiomatic Go to reuse the name 'err' with ':=' for subsequent errors.
0 commit comments