Improve validate-comps to give better info

This will tell us which checks failed, and how many. It also
suppresses some useless spammy output from `make sort` (we never
need to see any actual output, as it never tells us anything
useful; the useful info is what it changes).

Signed-off-by: Adam Williamson <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2023-04-24 10:49:28 -07:00
parent fcf37586a6
commit 03776c8c48

View File

@ -3,17 +3,24 @@
set -euxo pipefail
main() {
failure="false"
failure=0
make sort || failure="true"
make validate || failure="true"
make sort > /dev/null 2>&1 || {
echo "Sort failed!"
((failure+=1))
}
make validate || {
echo "Validate failed!"
((failure+=1))
}
# Fail if any changes were made to the repo
if [[ -n "(git status --short)" ]]; then
failure="true"
echo "git status failed!"
((failure+=1))
fi
if [[ "${failure}" == "true" ]]; then
echo "At least one check failed!"
if [[ $failure -gt 0 ]]; then
echo "${failure} check(s) failed!"
exit 1
fi
}