Merge pull request #121478 from pohly/golangci-lint-message

verify-golangci-lint.sh: clarify intended usage of warnings
This commit is contained in:
Kubernetes Prow Robot 2023-12-13 21:26:45 +01:00 committed by GitHub
commit e8c265169b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,18 +211,30 @@ else
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).'
if [ "$strict" ]; then
echo 'The more strict golangci-strict.yaml was used.'
echo
echo 'golangci-strict.yaml was used as configuration. Warnings must be fixed in'
echo 'new or modified code.'
elif [ "$hints" ]; then
echo 'The golangci-hints.yaml was used. Some of the reported issues may have to be fixed'
echo 'while others can be ignored, depending on the circumstances and/or personal'
echo 'preferences. To determine which issues have to be fixed, check the report that'
echo 'uses golangci-strict.yaml.'
echo
echo 'golangci-hints.yaml was used as configuration. Some of the reported issues may'
echo 'have to be fixed while others can be ignored, depending on the circumstances'
echo 'and/or personal preferences. To determine which issues have to be fixed, check'
echo 'the report that uses golangci-strict.yaml (= pull-kubernetes-verify-lint).'
fi
if [ "$strict" ] || [ "$hints" ]; then
echo
echo 'If you feel that this warns about issues that should be ignored by default,'
echo 'then please discuss with your reviewer and propose'
echo 'a change for hack/golangci.yaml.in as part of your PR.'
echo
echo 'Please do not create PRs which fix these issues in existing code just'
echo 'because the linter warns about them. Often they are harmless and not'
echo 'worth the cost associated with a PR (time required to review, code churn).'
echo 'Instead, propose to fix certain linter issues in an issue first and'
echo 'discuss there with maintainers. PRs are welcome if they address a real'
echo 'problem, which then needs to be explained in the PR.'
fi
echo
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/'