1
+ ---
1
2
linters :
2
3
disable-all : true
3
4
enable :
4
- - asciicheck
5
- - bodyclose
6
- - depguard
7
- - dogsled
8
- - errcheck
9
- - exportloopref
10
- - goconst
11
- - gocritic
12
- - gocyclo
13
- - godot
14
- - gofmt
15
- - goimports
16
- - goprintffuncname
17
- - gosec
18
- - gosimple
19
- - govet
20
- - importas
21
- - ineffassign
22
- - misspell
23
- - nakedret
24
- - nilerr
25
- - noctx
26
- - nolintlint
27
- - prealloc
28
- - predeclared
29
- - revive
30
- - rowserrcheck
31
- - staticcheck
32
- - stylecheck
33
- - thelper
34
- - typecheck
35
- - unconvert
36
- - unparam
37
- - unused
38
- - whitespace
5
+ - asasalint
6
+ - asciicheck
7
+ - bidichk
8
+ - bodyclose
9
+ - canonicalheader
10
+ # - copyloopvar // only on go1.22
11
+ - decorder
12
+ - dogsled
13
+ - durationcheck
14
+ - errcheck
15
+ - errchkjson
16
+ - errname
17
+ - exportloopref
18
+ - fatcontext
19
+ - ginkgolinter
20
+ - gocheckcompilerdirectives
21
+ - gochecksumtype
22
+ - goconst
23
+ - gocritic
24
+ - gocyclo
25
+ - godox
26
+ - gofmt
27
+ - gofumpt
28
+ - goheader
29
+ - goimports
30
+ - gomodguard
31
+ - goprintffuncname
32
+ - gosec
33
+ - gosimple
34
+ - gosmopolitan
35
+ - govet
36
+ - grouper
37
+ - importas
38
+ - ineffassign
39
+ # - intrange // only on go1.22
40
+ - loggercheck
41
+ - makezero
42
+ - mirror
43
+ - misspell
44
+ - musttag
45
+ - nakedret
46
+ - nolintlint
47
+ - nosprintfhostport
48
+ - perfsprint
49
+ - prealloc
50
+ - predeclared
51
+ - promlinter
52
+ - protogetter
53
+ - reassign
54
+ - revive
55
+ - rowserrcheck
56
+ - sloglint
57
+ - spancheck
58
+ - sqlclosecheck
59
+ - staticcheck
60
+ - stylecheck
61
+ - tagalign
62
+ - tenv
63
+ - testableexamples
64
+ - typecheck
65
+ - unconvert
66
+ - unparam
67
+ - unused
68
+ - usestdlibvars
69
+ - wastedassign
70
+ - whitespace
71
+ - zerologlint
72
+ # - containedctx
73
+ # - cyclop
74
+ # - depguard
75
+ # - dupword
76
+ # - err113
77
+ # - errorlint
78
+ # - exhaustive
79
+ # - exhaustruct
80
+ # - forbidigo
81
+ # - forcetypeassert
82
+ # - funlen
83
+ # - gci
84
+ # - gochecknoglobals
85
+ # - gochecknoinits
86
+ # - gocognit
87
+ # - godot
88
+ # - inamedparam
89
+ # - interfacebloat
90
+ # - ireturn
91
+ # - lll
92
+ # - maintidx
93
+ # - mnd
94
+ # - nestif
95
+ # - nilerr
96
+ # - nilnil
97
+ # - nlreturn
98
+ # - noctx
99
+ # - nonamedreturns
100
+ # - paralleltest
101
+ # - tagliatelle
102
+ # - testifylint
103
+ # - testpackage
104
+ # - thelper
105
+ # - tparallel
106
+ # - varnamelen
107
+ # - wrapcheck
108
+ # - wsl
39
109
40
110
linters-settings :
41
111
importas :
@@ -55,84 +125,72 @@ linters-settings:
55
125
# Controller Runtime
56
126
- pkg : sigs.k8s.io/controller-runtime
57
127
alias : ctrl
58
- staticcheck :
59
- go : " 1.18"
60
- stylecheck :
61
- go : " 1.18"
62
- depguard :
63
- rules :
64
- main :
65
- deny :
66
- - pkg : " io/ioutil"
67
- desc : " ioutil is deprecated starting with Go 1.16"
68
-
69
128
70
129
issues :
71
130
max-same-issues : 0
72
131
max-issues-per-linter : 0
73
132
# We are disabling default golangci exclusions because we want to help reviewers to focus on reviewing the most relevant
74
133
# changes in PRs and avoid nitpicking.
75
134
exclude-use-default : false
135
+ exclude-files :
136
+ - " zz_generated.*\\ .go$"
137
+ - " .*conversion.*\\ .go$"
138
+ exclude-dirs :
139
+ - mock*
76
140
# List of regexps of issue texts to exclude, empty list by default.
77
141
exclude :
78
- # The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
79
- # If it is decided they will not be addressed they should be moved above this comment.
80
- - Subprocess launch(ed with variable|ing should be audited)
81
- - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
82
- - (G104|G307)
142
+ # The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
143
+ # If it is decided they will not be addressed they should be moved above this comment.
144
+ - Subprocess launch(ed with variable|ing should be audited)
145
+ - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less)
146
+ - (G104|G307)
83
147
exclude-rules :
84
- - linters :
85
- - gosec
86
- text : " G108: Profiling endpoint is automatically exposed on /debug/pprof"
87
- - linters :
88
- - revive
89
- text : " exported: exported method .*\\ .(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
90
- - linters :
91
- - errcheck
92
- text : Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
93
- # With Go 1.16, the new embed directive can be used with an un-named import,
94
- # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us.
95
- # This directive allows the embed package to be imported with an underscore everywhere.
96
- - linters :
97
- - revive
98
- source : _ "embed"
99
- # Exclude some packages or code to require comments, for example test code, or fake clients.
100
- - linters :
101
- - revive
102
- text : exported (method|function|type|const) (.+) should have comment or be unexported
103
- source : (func|type).*Fake.*
104
- - linters :
105
- - revive
106
- text : exported (method|function|type|const) (.+) should have comment or be unexported
107
- path : fake_\.go
108
- - linters :
109
- - revive
110
- text : exported (method|function|type|const) (.+) should have comment or be unexported
111
- path : " (framework|e2e|infrastructure/docker)/.*.go"
112
- # Disable unparam "always receives" which might not be really
113
- # useful when building libraries.
114
- - linters :
115
- - unparam
116
- text : always receives
117
- # Dot imports for gomega or ginkgo are allowed
118
- # within test files.
119
- - path : _test\.go
120
- text : should not use dot imports
121
- - path : (framework|e2e)/.*.go
122
- text : should not use dot imports
123
- - path : _test\.go
124
- text : cyclomatic complexity
125
- # Append should be able to assign to a different var/slice.
126
- - linters :
127
- - gocritic
128
- text : " appendAssign: append result not assigned to the same slice"
129
-
148
+ - linters :
149
+ - gosec
150
+ text : " G108: Profiling endpoint is automatically exposed on /debug/pprof"
151
+ - linters :
152
+ - revive
153
+ text : " exported: exported method .*\\ .(Reconcile|SetupWithManager|SetupWebhookWithManager) should have comment or be unexported"
154
+ - linters :
155
+ - errcheck
156
+ text : Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked
157
+ # With Go 1.16, the new embed directive can be used with an un-named import,
158
+ # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us.
159
+ # This directive allows the embed package to be imported with an underscore everywhere.
160
+ - linters :
161
+ - revive
162
+ source : _ "embed"
163
+ # Exclude some packages or code to require comments, for example test code, or fake clients.
164
+ - linters :
165
+ - revive
166
+ text : exported (method|function|type|const) (.+) should have comment or be unexported
167
+ source : (func|type).*Fake.*
168
+ - linters :
169
+ - revive
170
+ text : exported (method|function|type|const) (.+) should have comment or be unexported
171
+ path : fake_\.go
172
+ - linters :
173
+ - revive
174
+ text : exported (method|function|type|const) (.+) should have comment or be unexported
175
+ path : " (framework|e2e|infrastructure/docker)/.*.go"
176
+ # Disable unparam "always receives" which might not be really
177
+ # useful when building libraries.
178
+ - linters :
179
+ - unparam
180
+ text : always receives
181
+ # Dot imports for gomega or ginkgo are allowed
182
+ # within test files.
183
+ - path : _test\.go
184
+ text : should not use dot imports
185
+ - path : (framework|e2e)/.*.go
186
+ text : should not use dot imports
187
+ - path : _test\.go
188
+ text : cyclomatic complexity
189
+ # Append should be able to assign to a different var/slice.
190
+ - linters :
191
+ - gocritic
192
+ text : " appendAssign: append result not assigned to the same slice"
130
193
131
194
run :
132
195
timeout : 10m
133
- skip-files :
134
- - " zz_generated.*\\ .go$"
135
- - " .*conversion.*\\ .go$"
136
- skip-dirs :
137
- - mock*
138
196
allow-parallel-runners : true
0 commit comments