Skip to content

Commit 01832ab

Browse files
committed
refresh
1 parent bc19709 commit 01832ab

File tree

5 files changed

+744
-52
lines changed

5 files changed

+744
-52
lines changed

Diff for: .golangci.yml

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

0 commit comments

Comments
 (0)