@@ -60,6 +60,7 @@ linters:
60
60
no-unaliased : true
61
61
revive :
62
62
rules :
63
+ # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
63
64
- name : blank-imports
64
65
- name : context-as-argument
65
66
- name : context-keys-type
@@ -81,6 +82,9 @@ linters:
81
82
- name : superfluous-else
82
83
- name : unreachable-code
83
84
- name : redefines-builtin-id
85
+ #
86
+ # Rules in addition to the recommended configuration above.
87
+ #
84
88
- name : bool-literal-in-expr
85
89
- name : constant-logical-expr
86
90
exclusions :
@@ -98,9 +102,13 @@ linters:
98
102
- linters :
99
103
- staticcheck
100
104
text : ' SA1019: .*The component config package has been deprecated and will be removed in a future release.'
105
+ # With Go 1.16, the new embed directive can be used with an un-named import,
106
+ # revive (previously, golint) only allows these to be imported in a main.go, which wouldn't work for us.
107
+ # This directive allows the embed package to be imported with an underscore everywhere.
101
108
- linters :
102
109
- revive
103
110
source : _ "embed"
111
+ # Exclude some packages or code to require comments, for example test code, or fake clients.
104
112
- linters :
105
113
- revive
106
114
text : exported (method|function|type|const) (.+) should have comment or be unexported
@@ -109,21 +117,28 @@ linters:
109
117
- revive
110
118
path : fake_\.go
111
119
text : exported (method|function|type|const) (.+) should have comment or be unexported
120
+ # Disable unparam "always receives" which might not be really
121
+ # useful when building libraries.
112
122
- linters :
113
123
- unparam
114
124
text : always receives
125
+ # Dot imports for gomega and ginkgo are allowed
126
+ # within test files.
115
127
- path : _test\.go
116
128
text : should not use dot imports
117
129
- path : _test\.go
118
130
text : cyclomatic complexity
119
131
- path : _test\.go
120
132
text : ' G107: Potential HTTP request made with variable url'
133
+ # Append should be able to assign to a different var/slice.
121
134
- linters :
122
135
- gocritic
123
136
text : ' appendAssign: append result not assigned to the same slice'
124
137
- linters :
125
138
- gocritic
126
139
text : ' singleCaseSwitch: should rewrite switch statement to if statement'
140
+ # It considers all file access to a filename that comes from a variable problematic,
141
+ # which is naiv at best.
127
142
- linters :
128
143
- gosec
129
144
text : ' G304: Potential file inclusion via variable'
@@ -135,7 +150,12 @@ linters:
135
150
path : .*/internal/.*
136
151
- linters :
137
152
- unused
153
+ # Seems to incorrectly trigger on the two implementations that are only
154
+ # used through an interface and not directly..?
155
+ # Likely same issue as https://github.com/dominikh/go-tools/issues/1616
138
156
path : pkg/controller/priorityqueue/metrics\.go
157
+ # The following are being worked on to remove their exclusion. This list should be reduced or go away all together over time.
158
+ # If it is decided they will not be addressed they should be moved above this comment.
139
159
- path : (.+)\.go$
140
160
text : Subprocess launch(ed with variable|ing should be audited)
141
161
- path : (.+)\.go$
0 commit comments