Debian Codegraph @

.golangci.yml

raw
1 # v2.0.0. Created based on golangci-lint v2.6.1
2
3 version: "2"
4
5 run:
6 timeout: 5m
7 modules-download-mode: readonly
8 allow-serial-runners: true
9
10 output:
11 sort-order:
12 - file
13 - linter
14
15 issues:
16 max-issues-per-linter: 0
17 max-same-issues: 0
18 uniq-by-line: false
19 # fix: true
20
21 linters:
22 exclusions:
23 paths:
24 - internal # TODO: Do not ignore interal packages
25 rules:
26 - linters:
27 - err113
28 text: 'do not define dynamic errors, use wrapped static errors instead.*'
29 - path: log/.*\\.go
30 linters:
31 - depguard
32 # Exclude some linters from running on tests files.
33 - path: _test\\.go
34 linters:
35 - bodyclose
36 settings:
37 depguard:
38 rules:
39 all:
40 list-mode: lax
41 deny:
42 - pkg: "flag"
43 desc: '`flag` package is only allowed in main.go'
44 - pkg: "log"
45 desc: 'logging is provided by `pkg/log`'
46 - pkg: "io/ioutil"
47 desc: '`io/ioutil` package is deprecated, use the `io` and `os` package instead'
48 # TODO: Prevent using these without a reason
49 # - pkg: "reflect"
50 # desc: '`reflect` package is dangerous to use'
51 # - pkg: "unsafe"
52 # desc: '`unsafe` package is dangerous to use'
53
54 errcheck:
55 check-type-assertions: true
56 check-blank: true
57 disable-default-exclusions: true
58 exclude-functions:
59 - '(*bytes.Buffer).Write' # always returns nil error
60 - '(*strings.Builder).WriteByte' # always returns nil error
61 - '(*strings.Builder).WriteString' # always returns nil error
62
63 errchkjson:
64 report-no-exported: true
65
66 exhaustive:
67 default-signifies-exhaustive: true
68
69 forbidigo:
70 forbid:
71 - pattern: ^print(ln)?$
72 - pattern: ^fmt\.Print(f|ln)?$
73 - pattern: ^http\.Default(Client|ServeMux|Transport)$
74 # TODO: Eventually enable these patterns
75 # - ^panic$
76 # - ^time\.Sleep$
77 analyze-types: true
78
79 goconst:
80 numbers: true
81
82 gocritic:
83 # TODO: Uncomment the following lines
84 enabled-tags:
85 - diagnostic
86 # - style
87 # - performance
88 # - experimental
89 # - opinionated
90 disabled-checks:
91 - ifElseChain
92 settings:
93 captLocal:
94 paramsOnly: false
95 elseif:
96 skipBalanced: false
97 underef:
98 skipRecvDeref: false
99 # NOTE: Set this option to false if other projects rely on this project's code
100 # unnamedResult:
101 # checkExported: false
102
103 gosec:
104 excludes:
105 - G104 # TODO: Enable this again. Mostly provided by errcheck
106 - G115
107 config:
108 global:
109 # show-ignored: true # TODO: Enable this
110 audit: true
111
112 govet:
113 enable-all: true
114 disable:
115 - fieldalignment
116 - shadow
117
118 grouper:
119 # const-require-grouping: true # TODO: Enable this
120 import-require-single-import: true
121 import-require-grouping: true
122 # var-require-grouping: true # TODO: Conflicts with gofumpt
123
124 loggercheck:
125 require-string-key: true
126 no-printf-like: true
127
128 misspell:
129 locale: US
130
131 nolintlint:
132 require-explanation: true
133 require-specific: true
134
135 nonamedreturns:
136 report-error-in-defer: true
137
138 perfsprint:
139 err-error: true
140
141 predeclared:
142 qualified-name: true
143
144 promlinter:
145 strict: true
146
147 # TODO: Enable this
148 # reassign:
149 # patterns:
150 # - '.*'
151
152 revive:
153 enable-all-rules: true
154 rules:
155 # Provided by gomnd linter
156 - name: add-constant
157 disabled: true
158 - name: argument-limit
159 disabled: true
160 # Provided by bidichk
161 - name: banned-characters
162 disabled: true
163 - name: cognitive-complexity
164 disabled: true
165 - name: comment-spacings
166 arguments:
167 - nolint
168 disabled: true # TODO: Do not disable
169 - name: cyclomatic
170 disabled: true
171 # TODO: Enable this check. Currently disabled due to upstream bug.
172 # - name: enforce-repeated-arg-type-style
173 # arguments:
174 # - short
175 - name: enforce-slice-style
176 arguments:
177 - make
178 disabled: true # TODO: Do not disable
179 - name: exported
180 disabled: true
181 - name: file-header
182 disabled: true
183 - name: function-result-limit
184 arguments: [3]
185 - name: function-length
186 disabled: true
187 - name: line-length-limit
188 disabled: true
189 - name: max-public-structs
190 disabled: true
191 - name: modifies-parameter
192 disabled: true
193 - name: nested-structs
194 disabled: true # TODO: Do not disable
195 - name: package-comments
196 disabled: true
197 - name: package-naming
198 disabled: true
199 - name: optimize-operands-order
200 disabled: true
201 - name: unchecked-type-assertion
202 disabled: true # TODO: Do not disable
203 - name: unhandled-error
204 disabled: true
205 - name: enforce-switch-style
206 disabled: true
207 - name: var-naming
208 disabled: true
209
210 staticcheck:
211 checks:
212 - all
213 - -QF1003
214 - -ST1000
215 - -ST1020
216 - -ST1021
217 - -ST1022
218
219 tagalign:
220 strict: true
221
222 tagliatelle:
223 case:
224 rules:
225 json: snake
226
227 testifylint:
228 enable-all: true
229
230 testpackage:
231 skip-regexp: "^$"
232
233 unparam:
234 # NOTE: Set this option to false if other projects rely on this project's code
235 check-exported: false
236
237 unused:
238 # TODO: Uncomment these two lines
239 # parameters-are-used: false
240 # local-variables-are-used: false
241 # NOTE: Set these options to true if other projects rely on this project's code
242 field-writes-are-uses: true
243 # exported-is-used: true # TODO: Fix issues with this option (upstream)
244 exported-fields-are-used: true
245
246 usestdlibvars:
247 http-method: true
248 http-status-code: true
249 time-weekday: false # TODO: Set to true
250 time-month: false # TODO: Set to true
251 time-layout: false # TODO: Set to true
252 crypto-hash: true
253 default-rpc-path: true
254 sql-isolation-level: true
255 tls-signature-scheme: true
256 constant-kind: true
257
258 wrapcheck:
259 ignore-package-globs:
260 - github.com/gofiber/utils/*
261 - github.com/valyala/fasthttp
262
263 enable:
264 - asasalint
265 - asciicheck
266 - bidichk
267 - bodyclose
268 - containedctx
269 - contextcheck
270 # - cyclop
271 - decorder
272 - depguard
273 - dogsled
274 # - dupl
275 # - dupword # TODO: Enable
276 - durationcheck
277 - errcheck
278 - errchkjson
279 - errname
280 - errorlint
281 - exhaustive
282 # - exhaustivestruct
283 # - exhaustruct
284 - forbidigo
285 - forcetypeassert
286 # - funlen
287 # - gci # TODO: Enable
288 - ginkgolinter
289 # - gocheckcompilerdirectives # TODO: Enable
290 # - gochecknoglobals # TODO: Enable
291 # - gochecknoinits # TODO: Enable
292 - gochecksumtype
293 # - gocognit
294 # - goconst # TODO: Enable
295 - gocritic
296 # - gocyclo
297 # - godot
298 # - godox
299 - err113
300 # - goheader
301 # - goimports
302 # - golint
303 # - gomnd # TODO: Enable
304 - gomoddirectives
305 # - gomodguard
306 - goprintffuncname
307 - gosec
308 # - gosmopolitan # TODO: Enable
309 - govet
310 - grouper
311 # - ifshort # TODO: Enable
312 # - importas
313 # - inamedparam
314 - ineffassign
315 # - interfacebloat
316 # - interfacer
317 # - ireturn
318 # - lll
319 - loggercheck
320 # - maintidx
321 - makezero
322 # - maligned
323 - mirror
324 - misspell
325 - modernize
326 - musttag
327 - nakedret
328 # - nestif
329 - nilerr
330 - nilnil
331 # - nlreturn
332 - noctx
333 - nolintlint
334 - nonamedreturns
335 - nosprintfhostport
336 # - paralleltest # TODO: Enable
337 - perfsprint
338 # - prealloc
339 - predeclared
340 - promlinter
341 - protogetter
342 - reassign
343 - revive
344 - rowserrcheck
345 # - scopelint # TODO: Enable
346 - sloglint
347 - spancheck
348 - sqlclosecheck
349 - staticcheck
350 # - stylecheck # TODO: Enable
351 # - tagalign # TODO: Enable
352 - tagliatelle
353 - testableexamples
354 - testifylint
355 # - testpackage # TODO: Enable
356 - thelper
357 - tparallel
358 - unconvert
359 - unparam
360 - unused
361 - usestdlibvars
362 # - varnamelen
363 # - wastedassign # TODO: Enable
364 - whitespace
365 #- wrapcheck
366 # - wsl
367 - zerologlint
368
369 formatters:
370 enable:
371 - gofmt
372 - gofumpt
373 settings:
374 gci:
375 sections:
376 - standard
377 - prefix(github.com/gofiber/utils)
378 - default
379 - blank
380 - dot
381 # - alias
382 custom-order: true
383 gofumpt:
384 module-path: github.com/gofiber/utils
385 extra-rules: true