Skip to content

Commit

Permalink
verify-golangci-lint fails to run in CI, code merging is not allowed
Browse files Browse the repository at this point in the history
Signed-off-by: wangyang <wangyang8126@gmail.com>
  • Loading branch information
wangyang0616 committed Apr 23, 2023
1 parent 58bd8ef commit 00ec400
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion hack/verify-golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,22 @@ function check_golangci-lint() {
function golangci-lint_run() {
echo "begin run golangci-lint"
cd ${KUBE_ROOT}
golangci-lint run -v
ret=0
golangci-lint run -v || ret=$?
if [ $ret -eq 0 ]; then
echo "SUCCESS: golangci-lint verified."
else
echo "FAILED: golangci-lint stale."
echo
echo "Please review the above warnings. You can test via './hack/verify-golangci-lint.sh' or 'make lint'."
echo "If the above warnings do not make sense, you can exempt this warning with a comment"
echo " (if your reviewer is okay with it)."
echo "In general please prefer to fix the error, we have already disabled specific lints"
echo " that the project chooses to ignore."
echo "See: https://golangci-lint.run/usage/false-positives/"
echo
exit 1
fi
}

set +e
Expand Down

0 comments on commit 00ec400

Please sign in to comment.