@@ -25,7 +25,6 @@ Usage: $0 [-r <revision>|-a] [-s] [-c none|<config>] [-- <golangci-lint run flag
25
25
-r <revision>: only report issues in code added since that revision
26
26
-a: automatically select the common base of origin/master and HEAD
27
27
as revision
28
- -s: select a strict configuration for new code
29
28
-n: in addition to strict checking, also enable hints (aka nits) that may or may not
30
29
be useful
31
30
-g <github action file>: also write results with --out-format=github-actions
@@ -53,7 +52,6 @@ invocation=(./hack/verify-golangci-lint.sh "$@")
53
52
golangci=(" ${GOBIN} /golangci-lint" run)
54
53
golangci_config=" ${KUBE_ROOT} /hack/golangci.yaml"
55
54
base=
56
- strict=
57
55
hints=
58
56
githubactions=
59
57
while getopts " ar:sng:c:" o; do
@@ -69,10 +67,6 @@ while getopts "ar:sng:c:" o; do
69
67
usage
70
68
fi
71
69
;;
72
- s)
73
- golangci_config=" ${KUBE_ROOT} /hack/golangci-strict.yaml"
74
- strict=1
75
- ;;
76
70
n)
77
71
golangci_config=" ${KUBE_ROOT} /hack/golangci-hints.yaml"
78
72
hints=1
@@ -185,18 +179,12 @@ else
185
179
echo " Please review the above warnings. You can test via \" ${invocation[*]} \" "
186
180
echo ' If the above warnings do not make sense, you can exempt this warning with a comment'
187
181
echo ' (if your reviewer is okay with it).'
188
- if [ " $strict " ]; then
189
- echo
190
- echo ' golangci-strict.yaml was used as configuration. Warnings must be fixed in'
191
- echo ' new or modified code.'
192
- elif [ " $hints " ]; then
182
+ if [ " $hints " ]; then
193
183
echo
194
184
echo ' golangci-hints.yaml was used as configuration. Some of the reported issues may'
195
185
echo ' have to be fixed while others can be ignored, depending on the circumstances'
196
186
echo ' and/or personal preferences. To determine which issues have to be fixed, check'
197
- echo ' the report that uses golangci-strict.yaml (= pull-kubernetes-verify-lint).'
198
- fi
199
- if [ " $strict " ] || [ " $hints " ]; then
187
+ echo ' the report that uses golangci.yaml (= pull-kubernetes-verify).'
200
188
echo
201
189
echo ' If you feel that this warns about issues that should be ignored by default,'
202
190
echo ' then please discuss with your reviewer and propose'
@@ -208,12 +196,13 @@ else
208
196
echo ' Instead, propose to fix certain linter issues in an issue first and'
209
197
echo ' discuss there with maintainers. PRs are welcome if they address a real'
210
198
echo ' problem, which then needs to be explained in the PR.'
199
+ else
200
+ echo
201
+ echo ' In general please prefer to fix the error, we have already disabled specific lints'
202
+ echo ' that the project chooses to ignore.'
203
+ echo ' See: https://golangci-lint.run/usage/false-positives/'
211
204
fi
212
205
echo
213
- echo ' In general please prefer to fix the error, we have already disabled specific lints'
214
- echo ' that the project chooses to ignore.'
215
- echo ' See: https://golangci-lint.run/usage/false-positives/'
216
- echo
217
206
} >&2
218
207
exit 1
219
208
fi
0 commit comments