1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!/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."
cat <<'END'
If these are real blocking todos, they must be fixed or downgraded before merge.
If these are not real todos, but literals, consider the following workarounds:
- In Rust source, use a numerical escape
example: maint/fixup-features/src/main.rs, const COMPLAINT
- In a shell script, interject or add redundant quoting
examples: maint/check_todos; maint/binary-size, call to mktemp
- In a regexp, use the "extended" format and insert spaces
example: maint/check_todos, head comment
- In a markdown doc, use a numerical escape, possibly converting `...` to <code>...<code>
example: CHANGELOG.md, entry for 0.0.3, under "Cleanups", 2nd bullet point
- In a comment, use a circumlocution
END
exit 1
;;
1)
# not found, great
exit 0
;;
*)
echo >&2 "git grep failed, status $?"
exit 16
;;
esac
|