-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yaml
More file actions
206 lines (206 loc) · 5.01 KB
/
Copy path.golangci.yaml
File metadata and controls
206 lines (206 loc) · 5.01 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
version: "2"
run:
issues-exit-code: 1
tests: true
output:
path-prefix: ""
linters:
default: none
enable:
- asasalint
- bidichk
- bodyclose
- canonicalheader
- dogsled
- dupl
- dupword
- err113
- decorder
- errcheck
- errname
- errorlint
- forcetypeassert
- funlen
- goconst
- gocritic
- gocyclo
- godot
- gosec
- govet
- iface
- ineffassign
- interfacebloat
- lll
- maintidx
- makezero
- misspell
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- paralleltest
- perfsprint
- prealloc
- predeclared
- protogetter
- reassign
- recvcheck
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- tagalign
- testifylint
- thelper
- unconvert
- unparam
# - unused
- usestdlibvars
- usetesting
- wastedassign
- whitespace
# - wrapcheck
settings:
errcheck:
check-type-assertions: true
check-blank: false
exclude-functions:
- fmt.Fprint
- fmt.Fprintf
- fmt.Fprintln
errorlint:
errorf: true
asserts: false
comparison: false
goconst:
min-len: 2
min-occurrences: 4
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
gosec:
excludes:
- G115
- G201
- G204
nlreturn:
block-size: 3
nolintlint:
require-explanation: false
require-specific: true
revive:
severity: warning
rules:
- name: atomic
- name: unexported-return
- name: errorf
- name: error-return
- name: error-naming
- name: if-return
- name: increment-decrement
- name: range
- name: receiver-naming
- name: empty-block
- name: confusing-naming
- name: unnecessary-stmt
- name: struct-tag
- name: modifies-value-receiver
- name: bool-literal-in-expr
- name: early-return
- name: unexported-naming
- name: nested-structs
staticcheck:
checks:
- "-ST1000"
# Dot imports are discouraged.
# https://staticcheck.dev/docs/checks/#ST1001
- ST1001
# Poorly chosen identifier.
# https://staticcheck.dev/docs/checks/#ST1003
- ST1003
# Incorrectly formatted error string.
# https://staticcheck.dev/docs/checks/#ST1005
- ST1005
# Poorly chosen receiver name.
# https://staticcheck.dev/docs/checks/#ST1006
- ST1006
# A function's error value should be its last return value.
# https://staticcheck.dev/docs/checks/#ST1008
- ST1008
# Poorly chosen name for variable of type 'time.Duration'.
# https://staticcheck.dev/docs/checks/#ST1011
- ST1011
# Poorly chosen name for error variable.
# https://staticcheck.dev/docs/checks/#ST1012
- ST1012
# Should use constants for HTTP error codes, not magic numbers.
# https://staticcheck.dev/docs/checks/#ST1013
- ST1013
# A switch's default case should be the first or last case.
# https://staticcheck.dev/docs/checks/#ST1015
- ST1015
# Use consistent method receiver names.
# https://staticcheck.dev/docs/checks/#ST1016
- ST1016
# Don't use Yoda conditions.
# https://staticcheck.dev/docs/checks/#ST1017
- ST1017
# Avoid zero-width and control characters in string literals.
# https://staticcheck.dev/docs/checks/#ST1018
- ST1018
# Importing the same package multiple times.
# https://staticcheck.dev/docs/checks/#ST1019
- ST1019
# The documentation of an exported function should start with the function's name.
# https://staticcheck.dev/docs/checks/#ST1020
- ST1020
# The documentation of an exported type should start with type's name.
# https://staticcheck.dev/docs/checks/#ST1021
- ST1021
# The documentation of an exported variable or constant should start with variable's name.
# https://staticcheck.dev/docs/checks/#ST1022
- ST1022
# Redundant type in variable declaration.
# https://staticcheck.dev/docs/checks/#ST1023
- ST1023
testifylint:
enable-all: true
disable:
- require-error
exclusions:
generated: lax
presets:
- common-false-positives
paths:
- cmd/Test.go
- internal/format/color/colorhex.go
- third_party$
- builtin$
- examples$
rules:
- path: "internal/cli/cli.go"
linters:
- funlen
- path: "internal/webhook/hook_test.go"
linters:
- funlen
issues:
uniq-by-line: true
formatters:
enable:
- gofumpt
- goimports
exclusions:
generated: lax
paths:
- cmd/Test.go
- third_party$
- builtin$
- examples$