skopeo/hack/validate-lint.sh
Miloslav Trmač 11fc49b491 Rely on golangci-lint exit code instead of expecting empty output
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2025-03-24 19:36:22 +01:00

17 lines
357 B
Bash
Executable File

#!/bin/bash
errors=$($GOBIN/golangci-lint run --build-tags "${BUILDTAGS}" 2>&1)
if [ "$?" -eq 0 ]; then
echo 'Congratulations! All Go source files have been linted.'
else
{
echo "Errors from golangci-lint:"
echo "$errors"
echo
echo 'Please fix the above errors. You can test via "golangci-lint" and commit the result.'
echo
} >&2
exit 1
fi