1- # Copyright 2024 The Kubernetes Authors.
1+ # Copyright 2025 The Kubernetes Authors.
22#
33# Licensed under the Apache License, Version 2.0 (the 'License');
44# you may not use this file except in compliance with the License.
1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ version : " 2"
1516run :
1617 modules-download-mode : readonly
17- issues :
18- exclude-rules :
19- # gosec recommends ignoring test files
20- - path : (.+)_test.go
21- linters :
22- - gosec
23- - path : tests/e2e
24- linters :
25- - gosec
26- - path : tests/sanity
27- linters :
28- - gosec
29- linters-settings :
30- revive :
31- rules :
32- # Using += 1 instead of ++ is fine
33- - name : increment-decrement
34- disabled : true
35- stylecheck :
36- # Dot importing ginkgo and gomega is standard practice
37- dot-import-whitelist :
38- - " github.com/onsi/gomega"
39- - " github.com/onsi/ginkgo/v2"
40- usetesting :
41- # Turning check for os.MkdirTemp() off as t.TempDir() is not sufficient for mounter and sanity tests in their current state.
42- os-mkdir-temp : false
4318linters :
44- enable-all : true
19+ default : all
4520 disable :
4621 - govet # We already run with `make verify/govet`
4722 # We do not use
@@ -52,7 +27,6 @@ linters:
5227 - funlen # Long func names happen
5328 - gocognit # Cognitive complexity
5429 - gocyclo # Cyclomatic complexity
55- - gofumpt # We don't rely on gofumpt
5630 - gomoddirectives # We need `replace` in `go.mod`
5731 - interfacebloat # No more than 10 interface methods
5832 - ireturn # Accept interfaces return concrete types
@@ -64,10 +38,53 @@ linters:
6438 - testpackage # Require separate test package to catch leaky unexported dependencies
6539 - varnamelen # Long var names happen
6640 - wsl # Too strict of a whitespace linter
41+ - wsl_v5 # Too strict
6742 # Consider adding in future
6843 - err113 # Do not create errors dynamically from scratch. Instead, wrap static (package-level) error.
6944 - wrapcheck # Same as err113
7045 - gochecknoglobals # Do not allow global variables
7146 - godox # Do not allow TODOs
7247 - nonamedreturns # Need to nolint/refactor a few places our code
7348 - paralleltest # There are many tests that aren't parallelized
49+ - funcorder # Many of our existing files are out of order
50+ - noinlineerr # We use inline errors
51+ - embeddedstructfieldcheck # We have a few instances of this
52+ settings :
53+ revive :
54+ rules :
55+ # Using += 1 instead of ++ is fine
56+ - name : increment-decrement
57+ disabled : true
58+ staticcheck :
59+ # Dot importing ginkgo and gomega is standard practice
60+ dot-import-whitelist :
61+ - github.com/onsi/gomega
62+ - github.com/onsi/ginkgo/v2
63+ usetesting :
64+ # Turning check for os.MkdirTemp() off as t.TempDir() is not sufficient for mounter and sanity tests in their current state.
65+ os-mkdir-temp : false
66+ exclusions :
67+ # Exclude files that look auto-generated
68+ generated : lax
69+ presets :
70+ - comments
71+ - common-false-positives
72+ - legacy
73+ rules :
74+ # gosec recommends ignoring test files
75+ - linters :
76+ - gosec
77+ path : (.+)_test.go
78+ - linters :
79+ - gosec
80+ path : tests/e2e
81+ - linters :
82+ - gosec
83+ path : tests/sanity
84+ formatters :
85+ enable :
86+ - gci
87+ - gofmt
88+ - goimports
89+ exclusions :
90+ generated : lax
0 commit comments