arti/maint/check_todos

32 lines
529 B
Plaintext
Raw Normal View History

2023-03-21 11:52:09 +00:00
#!/usr/bin/env bash
#
# check_todos
#
# Checks for occurrences of /\b X X X+ \b/e
# These will cause CI to fail if pushed anywhere.
set -euo pipefail
printf -- '---------- checking for to-be-rejected TODOs (XX''X) ----------\n'
set +e
git --no-pager grep -P '\bXX''X+\b'
rc=$?
set -e
case $rc in
0)
printf -- '"^^^^^^^^^^ found to-be-rejected TODOs (XX''X) ^^^^^^^^^^\n'
echo >&2 "
To-be-rejected-by-CI TODOs found."
exit 1
;;
1)
# not found, great
exit 0
;;
*)
echo >&2 "git grep failed, status $?"
exit 16
;;
esac