Repository navigation
Expand file tree
/
Copy path.golangci.yaml
More file actions
247 lines (247 loc) · 5.64 KB
/
Copy path.golangci.yaml
File metadata and controls
247 lines (247 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
version: "2"
linters:
default: none
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- durationcheck
- decorder
- dogsled
- durationcheck
# - err113
- errcheck
- errname
- errorlint
# - errchkjson
- exhaustive
- exptostd
- fatcontext
- forbidigo
- forcetypeassert
- funcorder
- gocheckcompilerdirectives
# - gochecknoinits
- goconst
- gocritic
- gomodguard_v2
- goprintffuncname
- gosec
- govet
- importas
- ineffassign
# - intrange
- loggercheck
- makezero
- mnd
- musttag
- nakedret
- nestif
- nilerr
- nilnil
# - nlreturn
- noctx
- nolintlint
- nonamedreturns
- nosprintfhostport
- perfsprint
- predeclared
- promlinter
- protogetter
- reassign
- revive
# - recvcheck
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- staticcheck
# - tagalign
# - tagliatelle # maybe we want this to force consistent config to ensure consistent tag alignment across the codebase
- testableexamples
- testifylint
- tparallel
- unconvert
- unparam
- unused
- usestdlibvars
- usetesting
- wastedassign
- whitespace
settings:
errcheck:
check-type-assertions: true
exhaustive:
check:
- switch
- map
goconst:
# Map/composite-literal keys repeat by nature (log attribute names, test
# tables); they are not extractable constants.
ignore-map-keys: true
gocritic:
settings:
captLocal:
paramsOnly: false
underef:
skipRecvDeref: false
gomodguard_v2:
blocked:
- module: github.com/golang/protobuf
recommendations:
- google.golang.org/protobuf
reason: see https://developers.google.com/protocol-buffers/docs/reference/go/faq#modules
- module: github.com/satori/go.uuid
recommendations:
- github.com/google/uuid
reason: satori's package is not maintained
- module: github.com/gofrs/uuid
recommendations:
- github.com/google/uuid
reason: gofrs' package is not go module
gosec:
excludes:
- G115
govet:
disable:
- fieldalignment
enable-all: true
settings:
shadow:
strict: true
mnd:
ignored-functions:
- os.Chmod
- os.Mkdir
- os.MkdirAll
- os.OpenFile
- os.WriteFile
- prometheus.ExponentialBuckets
- prometheus.ExponentialBucketsRange
- prometheus.LinearBuckets
nolintlint:
require-explanation: true
require-specific: true
rowserrcheck:
packages:
- github.com/jackc/pgx/v5
sloglint:
kv-only: false
no-mixed-args: true
static-msg: true
attr-only: true
no-raw-keys: false
msg-style: lowercased
key-naming-case: snake
forbidden-keys:
- time
- level
- msg
- source
- request
- req
- auth
- authorization
- token
args-on-sep-lines: true
tagliatelle:
case:
rules:
json: snake
mapstructure: snake
usetesting:
context-background: true
context-todo: true
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
- linters:
- lll
source: ^//\s*go:generate\s
- linters:
- godot
source: (noinspection|TODO)
- linters:
- gocritic
source: //noinspection
- linters:
- errorlint
source: ^\s+if _, ok := err\.\([^.]+\.InternalError\); ok {
- linters:
- bodyclose
- dupl
- funlen
- goconst
- gosec
- lll
- noctx
- wrapcheck
path: _test\.go
- linters:
- govet
text: 'shadow: declaration of "(err)" shadows declaration at'
- linters:
- goimport
text: http://www.apache.org/licenses/LICENSE-2.0
# otdfctl: defer refactoring-level lint fixes to follow-up
- path: otdfctl/
linters:
- contextcheck
text: should pass the context parameter
- path: otdfctl/
linters:
- revive
text: unused-parameter
- path: otdfctl/
linters:
- revive
text: unexported-return
- path: otdfctl/
linters:
- revive
text: var-naming
- path: otdfctl/
linters:
- nolintlint
text: "exhaustive"
# goconst: CLI table-column headers and other presentation strings
- path: otdfctl/
linters:
- goconst
# goconst: integration-test fixtures that escape the _test.go rule above
# only because of their filenames
- path: service/entityresolution/integration/
linters:
- goconst
paths:
- .*\.pb\.go
- .*\.pb\.gw.go
- sdk/sdkconnect/ # generated connect wrappers; forward deprecated RPCs
- otdfctl/tui/ # excluded during migration, matching original otdfctl lint config
- third_party$
- builtin$
issues:
max-issues-per-linter: 0
max-same-issues: 0
uniq-by-line: true
formatters:
enable:
- gofumpt
exclusions:
generated: lax
paths:
- .*\.pb\.go
- .*\.pb\.gw.go
- sdk/sdkconnect/ # generated connect wrappers; forward deprecated RPCs
- otdfctl/tui/
- third_party$
- builtin$