aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-todos.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-03-06 14:05:23 -0300
committerEuAndreh <eu@euandre.org>2022-03-06 14:05:23 -0300
commit5f52853ce4a03b0b1c1dc6a4f252bd8107083652 (patch)
treeba688c4057825dc1baad699a207a03e6ac1baa7f /aux/workflow/assert-todos.sh
parentTODOs.md: Add #td-d5370885-16f3-acf8-7e7a-a65d794242ee (diff)
downloadeuandre.org-5f52853ce4a03b0b1c1dc6a4f252bd8107083652.tar.gz
euandre.org-5f52853ce4a03b0b1c1dc6a4f252bd8107083652.tar.xz
aux/: Update
Diffstat (limited to '')
-rwxr-xr-xaux/workflow/assert-todos.sh61
1 files changed, 9 insertions, 52 deletions
diff --git a/aux/workflow/assert-todos.sh b/aux/workflow/assert-todos.sh
index bc4907d..f4fd965 100755
--- a/aux/workflow/assert-todos.sh
+++ b/aux/workflow/assert-todos.sh
@@ -1,58 +1,15 @@
#!/bin/sh
set -eu
-if [ -e .git ] && git grep FIXME | grep -v '^TODOs.md' |
- grep -v '^aux/workflow/assert-todos.sh'; then
- echo "Found dangling FIXME markers on the project."
- echo "You should write them down properly on TODOs.md."
+# shellcheck disable=2086
+if [ -e .git ] &&
+ git grep FIXME ${1:-} |
+ grep -v '^TODOs.md:' |
+ grep -v '^aux/workflow/assert-todos.sh:'
+then
+ echo "Found dangling FIXME markers on the project." >&2
+ echo "You should write them down properly on TODOs.md." >&2
exit 1
fi
-awk -F'{#' '
-BEGIN {
- exitstatus = 0
- h2flag = 0
- h2status = ""
- prevline = ""
- idx = 0
- delete ids[0]
-}
-h2flag == 1 {
- split($0, l, " ")
- timelinestatus = l[2]
- if (h2status != timelinestatus) {
- print "h2/timeline status mismatch for line " NR-1
- print prevline
- print $0
- exitstatus = 1
- }
- h2status = ""
- h2flag = 0
-}
-
-/^## (TODO|DOING|WAITING|MEETING|INACTIVE|NEXT|CANCELLED|DONE|WONTFIX)/ {
- if (match($0, / \{#.*?\}.*$/) == 0) {
- print "Missing ID for line " NR ":\n" $0
- exitstatus = 1
- }
- id_with_prefix = substr($2, 0, length($2) - 1)
- match(id_with_prefix, /^\w+-/)
- id = substr(id_with_prefix, RLENGTH + 1)
- if (id in arr) {
- print "Duplicate ID: " id
- exitstatus = 1
- } else {
- arr[id] = 1
- }
-
- split($0, l, " ")
- h2status = l[2]
- h2flag = 1
- prevline = $0
-}
-
-
-/^# Scratch$/ {
- exit exitstatus
-}
-' TODOs.md
+td -L