Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

verify-golangci-lint fails to run in CI, code merging is not allowed #2808

Merged
merged 1 commit into from
Apr 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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