You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 12, 2025. It is now read-only.
# Enable to require nolint directives to mention the specific linter being suppressed.
78
-
# Default: false
166
+
allow-unused: false
167
+
allow-leading-space: false
79
168
require-specific: true
80
169
revive:
81
170
rules:
171
+
# The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
172
+
- name: blank-imports
173
+
- name: context-as-argument
174
+
- name: context-keys-type
175
+
- name: dot-imports
176
+
- name: error-return
177
+
- name: error-strings
178
+
- name: error-naming
179
+
- name: exported
180
+
- name: if-return
181
+
- name: increment-decrement
182
+
- name: var-naming
183
+
- name: var-declaration
184
+
- name: package-comments
185
+
- name: range
186
+
- name: time-naming
187
+
- name: unexported-return
188
+
- name: indent-error-flow
189
+
- name: errorf
190
+
- name: empty-block
191
+
- name: superfluous-else
82
192
- name: unused-parameter
83
-
disabled: true
193
+
- name: unreachable-code
194
+
- name: redefines-builtin-id
195
+
#
196
+
# Rules in addition to the recommended configuration above.
197
+
#
198
+
- name: bool-literal-in-expr
199
+
- name: constant-logical-expr
84
200
85
-
run:
86
-
go: '1.19'
87
-
timeout: 10m
88
-
skip-files:
89
-
- "zz_generated.*\\.go$"
90
-
- ".*conversion.*\\.go$"
91
-
allow-parallel-runners: true
201
+
issues:
202
+
max-same-issues: 0
203
+
max-issues-per-linter: 0
204
+
# We are disabling default golangci exclusions because we want to help reviewers to focus on reviewing the most relevant
205
+
# changes in PRs and avoid nitpicking.
206
+
exclude-use-default: false
207
+
exclude-rules:
208
+
- path: api/v1alpha3
209
+
linters:
210
+
- revive
211
+
- gosec
212
+
- stylecheck
213
+
# Specific exclude rules for deprecated fields that are still part of the codebase. These
214
+
# should be removed as the referenced deprecated item is removed from the project.
215
+
- linters:
216
+
- staticcheck
217
+
text: "SA1019: (noderefutil.*|parsed.*) is deprecated"
218
+
# Specific exclude rules for deprecated fields that are still part of the codebase. These
219
+
# should be removed as the referenced deprecated item is removed from the project.
220
+
- linters:
221
+
- staticcheck
222
+
text: "SA1019: (bootstrapv1.ClusterStatus|scope.Config.Spec.UseExperimentalRetryJoin|DockerMachine.Spec.Bootstrapped|machineStatus.Bootstrapped) is deprecated"
223
+
# Specific exclude rules for deprecated packages that are still part of the codebase. These
224
+
# should be removed as the referenced deprecated packages are removed from the project.
225
+
- linters:
226
+
- staticcheck
227
+
text: "SA1019: .* is deprecated: This package will be removed in one of the next releases."
228
+
# Specific exclude rules for deprecated types that are still part of the codebase. These
229
+
# should be removed as the referenced deprecated types are removed from the project.
230
+
- linters:
231
+
- staticcheck
232
+
text: "SA1019: (clusterv1alpha4.*) is deprecated: This type will be removed in one of the next releases."
233
+
- linters:
234
+
- revive
235
+
text: "exported: exported method .*\\.(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
236
+
- linters:
237
+
- errcheck
238
+
text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
239
+
# Exclude some packages or code to require comments, for example test code, or fake clients.
240
+
- linters:
241
+
- revive
242
+
text: exported (method|function|type|const) (.+) should have comment or be unexported
243
+
source: (func|type).*Fake.*
244
+
- linters:
245
+
- revive
246
+
text: exported (method|function|type|const) (.+) should have comment or be unexported
247
+
path: fake_\.go
248
+
- linters:
249
+
- revive
250
+
text: exported (method|function|type|const) (.+) should have comment or be unexported
251
+
path: cmd/clusterctl/internal/test/providers.*.go
252
+
- linters:
253
+
- revive
254
+
text: exported (method|function|type|const) (.+) should have comment or be unexported
255
+
path: "(framework|e2e)/.*.go"
256
+
# Disable unparam "always receives" which might not be really
257
+
# useful when building libraries.
258
+
- linters:
259
+
- unparam
260
+
text: always receives
261
+
# Dot imports for gomega and ginkgo are allowed
262
+
# within test files and test utils.
263
+
- linters:
264
+
- revive
265
+
- stylecheck
266
+
path: _test\.go
267
+
text: should not use dot imports
268
+
- linters:
269
+
- revive
270
+
- stylecheck
271
+
path: (framework|e2e)/.*.go
272
+
text: should not use dot imports
273
+
- linters:
274
+
- revive
275
+
- stylecheck
276
+
path: util/defaulting/defaulting.go
277
+
text: should not use dot imports
278
+
# Append should be able to assign to a different var/slice.
279
+
- linters:
280
+
- gocritic
281
+
text: "appendAssign: append result not assigned to the same slice"
282
+
# Disable linters for conversion
283
+
- linters:
284
+
- staticcheck
285
+
text: "SA1019: in.(.+) is deprecated"
286
+
path: .*(api|types)\/.*\/conversion.*\.go$
287
+
- linters:
288
+
- revive
289
+
# Checking if an error is nil to just after return the error or nil is redundant
290
+
text: "if-return: redundant if ...; err != nil check, just return error instead"
291
+
# Ignoring stylistic checks for generated code
292
+
path: .*(api|types|test)\/.*\/conversion.*\.go$
293
+
- linters:
294
+
- revive
295
+
# Exported function and methods should have comments. This warns on undocumented exported functions and methods.
296
+
text: exported (method|function|type|const) (.+) should have comment or be unexported
297
+
# Ignoring stylistic checks for generated code
298
+
path: .*(api|types|test)\/.*\/conversion.*\.go$
299
+
- linters:
300
+
- revive
301
+
# This rule warns when initialism, variable or package naming conventions are not followed.
302
+
text: "var-naming: don't use underscores in Go names;"
303
+
# Ignoring stylistic checks for generated code
304
+
path: .*(api|types|test)\/.*\/conversion.*\.go$
305
+
- linters:
306
+
- revive
307
+
# By convention, receiver names in a method should reflect their identity.
308
+
text: "receiver-naming: receiver name"
309
+
# Ignoring stylistic checks for generated code
310
+
path: .*(api|types)\/.*\/conversion.*\.go$
311
+
- linters:
312
+
- stylecheck
313
+
text: "ST1003: should not use underscores in Go names;"
314
+
path: .*(api|types|test)\/.*\/conversion.*\.go$
315
+
- linters:
316
+
- stylecheck
317
+
text: "ST1016: methods on the same type should have the same receiver name"
318
+
path: .*(api|types)\/.*\/conversion.*\.go$
319
+
# We don't care about defer in for loops in test files.
320
+
- linters:
321
+
- gocritic
322
+
text: "deferInLoop: Possible resource leak, 'defer' is called in the 'for' loop"
0 commit comments