File tree Expand file tree Collapse file tree 5 files changed +37
-6
lines changed
exp/addons/internal/controllers
internal/controllers/machine Expand file tree Collapse file tree 5 files changed +37
-6
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,38 @@ linters-settings:
152
152
allow-unused : false
153
153
allow-leading-space : false
154
154
require-specific : true
155
+ revive :
156
+ rules :
157
+ # The following rules are recommended https://github.com/mgechev/revive#recommended-configuration
158
+ - name : blank-imports
159
+ - name : context-as-argument
160
+ - name : context-keys-type
161
+ - name : dot-imports
162
+ - name : error-return
163
+ - name : error-strings
164
+ - name : error-naming
165
+ - name : exported
166
+ # - name: if-return # TODO This is a recommended rule with many findings which may require it's own pr.
167
+ - name : increment-decrement
168
+ - name : var-naming
169
+ - name : var-declaration
170
+ - name : package-comments
171
+ - name : range
172
+ - name : receiver-naming
173
+ - name : time-naming
174
+ - name : unexported-return
175
+ - name : indent-error-flow
176
+ - name : errorf
177
+ - name : empty-block
178
+ - name : superfluous-else
179
+ # - name: unused-parameter # TODO This is a recommended rule with many findings which may require it's own pr.
180
+ - name : unreachable-code
181
+ - name : redefines-builtin-id
182
+ #
183
+ # Rules in addition to the recommended configuration above.
184
+ #
185
+ - name : bool-literal-in-expr
186
+ - name : constant-logical-expr
155
187
gosec :
156
188
excludes :
157
189
- G307 # Deferring unsafe method "Close" on type "\*os.File"
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ metadata:
188
188
return false
189
189
}
190
190
191
- if binding .Spec .Bindings [0 ].Resources [0 ].Applied != true || binding .Spec .Bindings [0 ].Resources [1 ].Applied != true {
191
+ if ! binding .Spec .Bindings [0 ].Resources [0 ].Applied || ! binding .Spec .Bindings [0 ].Resources [1 ].Applied {
192
192
return false
193
193
}
194
194
Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ func TestMachine_Reconcile(t *testing.T) {
282
282
if err := env .Get (ctx , key , machine ); err != nil {
283
283
return false
284
284
}
285
- if conditions .Has (machine , clusterv1 .InfrastructureReadyCondition ) != true {
285
+ if ! conditions .Has (machine , clusterv1 .InfrastructureReadyCondition ) {
286
286
return false
287
287
}
288
288
readyCondition := conditions .Get (machine , clusterv1 .ReadyCondition )
Original file line number Diff line number Diff line change @@ -627,7 +627,7 @@ func TestPatchHelper(t *testing.T) {
627
627
return false
628
628
}
629
629
630
- return objAfter .Spec .Paused == true &&
630
+ return objAfter .Spec .Paused &&
631
631
reflect .DeepEqual (obj .Spec .InfrastructureRef , objAfter .Spec .InfrastructureRef )
632
632
}, timeout ).Should (BeTrue ())
633
633
})
Original file line number Diff line number Diff line change @@ -104,9 +104,8 @@ func newBuildIdentifiers(ids []string) buildIdentifiers {
104
104
func (v buildIdentifiers ) compare (o buildIdentifiers ) int {
105
105
i := 0
106
106
for ; i < len (v ) && i < len (o ); i ++ {
107
- if comp := v [i ].compare (o [i ]); comp == 0 {
108
- continue
109
- } else {
107
+ comp := v [i ].compare (o [i ])
108
+ if comp != 0 {
110
109
return comp
111
110
}
112
111
}
You can’t perform that action at this time.
0 commit comments