Skip to content

Commit 5b0d765

Browse files
authored
chore: clean-up golangci-lint configuration (#22544)
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 6bee96c commit 5b0d765

File tree

1 file changed

+90
-30
lines changed

1 file changed

+90
-30
lines changed

.golangci.yaml

Lines changed: 90 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
version: "2"
1+
formatters:
2+
enable:
3+
- gofumpt
4+
- goimports
5+
6+
settings:
7+
goimports:
8+
local-prefixes:
9+
- github.com/argoproj/argo-cd/v3
10+
211
issues:
312
max-issues-per-linter: 0
13+
414
max-same-issues: 0
15+
516
linters:
6-
exclusions:
7-
rules:
8-
- linters:
9-
- unparam
10-
path: (.+)_test\.go
11-
- path: (.+)\.go$
12-
text: SA5011
13-
paths:
14-
- third_party$
15-
- builtin$
16-
- examples$
17-
presets:
18-
- comments
19-
- common-false-positives
20-
- legacy
21-
- std-error-handling
2217
enable:
2318
- errorlint
2419
- gocritic
@@ -27,12 +22,28 @@ linters:
2722
- misspell
2823
- perfsprint
2924
- revive
25+
- staticcheck
3026
- testifylint
3127
- thelper
3228
- unparam
3329
- usestdlibvars
3430
- usetesting
3531
- whitespace
32+
33+
exclusions:
34+
rules:
35+
- linters:
36+
- unparam
37+
path: (.+)_test\.go
38+
39+
presets:
40+
- comments
41+
- common-false-positives
42+
- legacy
43+
- std-error-handling
44+
45+
warn-unused: true
46+
3647
settings:
3748
gocritic:
3849
disabled-checks:
@@ -41,41 +52,55 @@ linters:
4152
- exitAfterDefer
4253
- mapKey
4354
- typeSwitchVar
55+
4456
gomodguard:
4557
blocked:
4658
modules:
4759
- github.com/golang-jwt/jwt/v4:
4860
recommendations:
4961
- github.com/golang-jwt/jwt/v5
62+
5063
- github.com/imdario/mergo:
5164
recommendations:
5265
- dario.cat/mergo
5366
reason: '`github.com/imdario/mergo` has been renamed.'
67+
5468
- github.com/pkg/errors:
5569
recommendations:
5670
- errors
71+
5772
importas:
5873
alias:
5974
- pkg: github.com/golang-jwt/jwt/v5
6075
alias: jwtgo
76+
6177
- pkg: k8s.io/api/apps/v1
6278
alias: appsv1
79+
6380
- pkg: k8s.io/api/core/v1
6481
alias: corev1
82+
6583
- pkg: k8s.io/api/rbac/v1
6684
alias: rbacv1
85+
6786
- pkg: k8s.io/apimachinery/pkg/api/errors
6887
alias: apierrors
88+
6989
- pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1
7090
alias: apiextensionsv1
91+
7192
- pkg: k8s.io/apimachinery/pkg/apis/meta/v1
7293
alias: metav1
94+
7395
- pkg: k8s.io/client-go/informers/core/v1
7496
alias: informersv1
97+
7598
- pkg: errors
7699
alias: stderrors
100+
77101
nolintlint:
78102
require-specific: true
103+
79104
perfsprint:
80105
# Optimizes even if it requires an int or uint type cast.
81106
int-conversion: true
@@ -87,80 +112,115 @@ linters:
87112
sprintf1: true
88113
# Optimizes into strings concatenation.
89114
strconcat: true
115+
90116
revive:
91117
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md
92118
rules:
93119
- name: bool-literal-in-expr
120+
94121
- name: blank-imports
95122
disabled: true
123+
96124
- name: context-as-argument
97125
arguments:
98126
- allowTypesBefore: '*testing.T,testing.TB'
127+
99128
- name: context-keys-type
100129
disabled: true
130+
101131
- name: dot-imports
102132
disabled: true
133+
103134
- name: duplicated-imports
135+
104136
- name: early-return
105137
arguments:
106138
- preserveScope
139+
107140
- name: empty-block
108141
disabled: true
142+
109143
- name: error-naming
110144
disabled: true
145+
111146
- name: error-return
147+
112148
- name: error-strings
113149
disabled: true
150+
114151
- name: errorf
152+
115153
- name: identical-branches
154+
116155
- name: if-return
156+
117157
- name: increment-decrement
158+
118159
- name: indent-error-flow
119160
arguments:
120161
- preserveScope
162+
121163
- name: modifies-parameter
164+
122165
- name: optimize-operands-order
166+
123167
- name: range
168+
124169
- name: receiver-naming
170+
125171
- name: redefines-builtin-id
126172
disabled: true
173+
127174
- name: redundant-import-alias
175+
128176
- name: superfluous-else
129177
arguments:
130178
- preserveScope
179+
131180
- name: time-equal
181+
132182
- name: time-naming
133183
disabled: true
184+
134185
- name: unexported-return
135186
disabled: true
187+
136188
- name: unnecessary-stmt
189+
137190
- name: unreachable-code
191+
138192
- name: unused-parameter
193+
139194
- name: use-any
195+
140196
- name: useless-break
197+
141198
- name: var-declaration
199+
142200
- name: var-naming
143201
arguments:
144202
- - ID
145203
- - VM
146204
- - skipPackageNameChecks: true
147205
upperCaseConst: true
206+
207+
staticcheck:
208+
checks:
209+
- all
210+
- -SA5011
211+
- -ST1003
212+
- -ST1016
213+
148214
testifylint:
149215
enable-all: true
216+
150217
disable:
151218
- go-require
219+
152220
usetesting:
153221
os-mkdir-temp: false
154-
formatters:
155-
enable:
156-
- gofumpt
157-
- goimports
158-
settings:
159-
goimports:
160-
local-prefixes:
161-
- github.com/argoproj/argo-cd/v3
162-
exclusions:
163-
paths:
164-
- third_party$
165-
- builtin$
166-
- examples$
222+
223+
output:
224+
show-stats: false
225+
226+
version: "2"

0 commit comments

Comments
 (0)