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.
37
-
check-blank: true
38
-
# Do not report about not checking of errors in type assertions.
39
-
# This is not as dangerous as skipping error values because an unchecked type assertion just immediately panics.
40
-
# We disable this because it makes a ton of useless noise esp. in test code.
41
-
check-type-assertions: false
42
-
exclude-functions:
43
-
- goimports
44
-
forbidigo:
45
-
analyze-types: true # required for pkg:
46
-
forbid:
47
-
# ioutil package has been deprecated: https://github.com/golang/go/issues/42026
48
-
- ^ioutil\..*$
49
-
# Using http.DefaultServeMux is discouraged because it's a global variable that some packages silently and magically add handlers to (esp. net/http/pprof).
50
-
# Applications wishing to use http.ServeMux should obtain local instances through http.NewServeMux() instead of using the global default instance.
51
-
- ^http\.DefaultServeMux$
52
-
- ^http\.Handle(?:Func)?$
53
-
# Forbid usage of old and archived square/go-jose
54
-
- pkg: ^gopkg\.in/square/go-jose\.v2$
55
-
msg: "gopk.in/square/go-jose is archived and has CVEs. Replace it with gopkg.in/go-jose/go-jose.v2"
56
-
- pkg: ^github.com/coreos/go-oidc$
57
-
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"
58
-
59
-
- pkg: ^github.com/howeyc/gopass$
60
-
msg: "github.com/howeyc/gopass is archived, use golang.org/x/term instead"
61
-
goconst:
62
-
ignore-tests: true
63
-
min-occurrences: 5
64
-
gocritic:
65
-
enabled-checks:
66
-
- boolExprSimplify
67
-
- builtinShadow
68
-
- emptyStringTest
69
-
- evalOrder
70
-
- httpNoBody
71
-
- importShadow
72
-
- initClause
73
-
- methodExprCall
74
-
- paramTypeCombine
75
-
- preferFilepathJoin
76
-
- ptrToRefParam
77
-
- redundantSprint
78
-
- returnAfterHttpError
79
-
- stringConcatSimplify
80
-
- timeExprSimplify
81
-
- truncateCmp
82
-
- typeAssertChain
83
-
- typeUnparen
84
-
- unnamedResult
85
-
- unnecessaryBlock
86
-
- unnecessaryDefer
87
-
- weakCond
88
-
- yodaStyleExpr
89
-
goimports:
90
-
# Put local imports after 3rd-party packages.
91
-
local-prefixes: github.com/cobaltcore-dev/cortex
92
-
gosec:
93
-
excludes:
94
-
# 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/onsi/ginkgo/v2
107
-
- github.com/onsi/gomega
108
-
usestdlibvars:
109
-
constant-kind: true
110
-
crypto-hash: true
111
-
default-rpc-path: true
112
-
http-method: true
113
-
http-status-code: true
114
-
sql-isolation-level: true
115
-
time-layout: true
116
-
time-month: true
117
-
time-weekday: true
118
-
tls-signature-scheme: true
119
-
whitespace:
120
-
# Enforce newlines (or comments) after multi-line function signatures.
121
-
multi-func: true
122
-
123
24
linters:
124
-
# We use 'disable-all' and enable linters explicitly so that a newer version
125
-
# does not introduce new linters unexpectedly.
126
-
disable-all: true
25
+
# Disable all pre-enabled linters and enable them explicitly so that a newer version does not introduce new linters unexpectedly
26
+
default: none
127
27
enable:
128
28
- bodyclose
129
29
- containedctx
130
30
- copyloopvar
131
-
# Produces false positives with strings such as SQL queries.
132
-
# - dupl
133
31
- dupword
134
32
- durationcheck
135
33
- errcheck
136
34
- errname
137
35
- errorlint
36
+
- exptostd
138
37
- forbidigo
139
38
- ginkgolinter
140
39
- gocheckcompilerdirectives
141
40
- goconst
142
41
- gocritic
143
-
- gofmt
144
-
# Disabled for now - produces too many false positives
145
-
# - goimports
146
42
- gosec
147
-
- gosimple
148
43
- govet
149
44
- ineffassign
150
45
- intrange
@@ -158,11 +53,126 @@ linters:
158
53
- rowserrcheck
159
54
- sqlclosecheck
160
55
- staticcheck
161
-
- stylecheck
162
-
- tenv
163
-
- typecheck
164
56
- unconvert
165
57
- unparam
166
58
- unused
167
59
- usestdlibvars
60
+
- usetesting
168
61
- whitespace
62
+
settings:
63
+
errcheck:
64
+
check-type-assertions: false
65
+
# Report about assignment of errors to blank identifier.
66
+
check-blank: true
67
+
# Do not report about not checking of errors in type assertions.
68
+
# This is not as dangerous as skipping error values because an unchecked type assertion just immediately panics.
69
+
# We disable this because it makes a ton of useless noise esp. in test code.
70
+
forbidigo:
71
+
analyze-types: true # required for pkg:
72
+
forbid:
73
+
# ioutil package has been deprecated: https://github.com/golang/go/issues/42026
74
+
- pattern: ^ioutil\..*$
75
+
# Using http.DefaultServeMux is discouraged because it's a global variable that some packages silently and magically add handlers to (esp. net/http/pprof).
76
+
# Applications wishing to use http.ServeMux should obtain local instances through http.NewServeMux() instead of using the global default instance.
77
+
- pattern: ^http\.DefaultServeMux$
78
+
- pattern: ^http\.Handle(?:Func)?$
79
+
- pkg: ^gopkg\.in/square/go-jose\.v2$
80
+
msg: gopk.in/square/go-jose is archived and has CVEs. Replace it with gopkg.in/go-jose/go-jose.v2
81
+
- pkg: ^github.com/coreos/go-oidc$
82
+
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
83
+
- pkg: ^github.com/howeyc/gopass$
84
+
msg: github.com/howeyc/gopass is archived, use golang.org/x/term instead
85
+
goconst:
86
+
min-occurrences: 5
87
+
gocritic:
88
+
enabled-checks:
89
+
- boolExprSimplify
90
+
- builtinShadow
91
+
- emptyStringTest
92
+
- evalOrder
93
+
- httpNoBody
94
+
- importShadow
95
+
- initClause
96
+
- methodExprCall
97
+
- paramTypeCombine
98
+
- preferFilepathJoin
99
+
- ptrToRefParam
100
+
- redundantSprint
101
+
- returnAfterHttpError
102
+
- stringConcatSimplify
103
+
- timeExprSimplify
104
+
- truncateCmp
105
+
- typeAssertChain
106
+
- typeUnparen
107
+
- unnamedResult
108
+
- unnecessaryBlock
109
+
- unnecessaryDefer
110
+
- weakCond
111
+
- yodaStyleExpr
112
+
gomoddirectives:
113
+
replace-allow-list:
114
+
# for go-pmtud
115
+
- github.com/mdlayher/arp
116
+
toolchain-forbidden: true
117
+
go-version-pattern: 1\.\d+(\.0)?$
118
+
gosec:
119
+
excludes:
120
+
# 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/
121
+
- G112
122
+
# created file permissions are restricted by umask if necessary
123
+
- G306
124
+
govet:
125
+
disable:
126
+
- fieldalignment
127
+
enable-all: true
128
+
nolintlint:
129
+
require-specific: true
130
+
staticcheck:
131
+
dot-import-whitelist:
132
+
- github.com/majewsky/gg/option
133
+
- github.com/onsi/ginkgo/v2
134
+
- github.com/onsi/gomega
135
+
usestdlibvars:
136
+
http-method: true
137
+
http-status-code: true
138
+
time-weekday: true
139
+
time-month: true
140
+
time-layout: true
141
+
crypto-hash: true
142
+
default-rpc-path: true
143
+
sql-isolation-level: true
144
+
tls-signature-scheme: true
145
+
constant-kind: true
146
+
usetesting:
147
+
os-temp-dir: true
148
+
whitespace:
149
+
# Enforce newlines (or comments) after multi-line function signatures.
150
+
multi-func: true
151
+
exclusions:
152
+
generated: lax
153
+
presets:
154
+
- comments
155
+
- common-false-positives
156
+
- legacy
157
+
- std-error-handling
158
+
rules:
159
+
- linters:
160
+
- bodyclose
161
+
path: _test\.go
162
+
# It is idiomatic Go to reuse the name 'err' with ':=' for subsequent errors.
Copy file name to clipboardExpand all lines: Makefile
+2-1
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ install-goimports: FORCE
23
23
@if !hash goimports 2>/dev/null;thenprintf"\e[1;36m>> Installing goimports (this may take a while)...\e[0m\n"; go install golang.org/x/tools/cmd/goimports@latest;fi
24
24
25
25
install-golangci-lint: FORCE
26
-
@if !hash golangci-lint 2>/dev/null;thenprintf"\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest;fi
26
+
@if !hash golangci-lint 2>/dev/null;thenprintf"\e[1;36m>> Installing golangci-lint (this may take a while)...\e[0m\n"; go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest;fi
27
27
28
28
install-go-licence-detector: FORCE
29
29
@if !hash go-licence-detector 2>/dev/null;thenprintf"\e[1;36m>> Installing go-licence-detector (this may take a while)...\e[0m\n"; go install go.elastic.co/go-licence-detector@latest;fi
@@ -77,6 +77,7 @@ check: FORCE static-check build/cover.html build-all
0 commit comments