diff options
author | EuAndreh <eu@euandre.org> | 2021-01-24 12:43:59 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-01-24 12:43:59 -0300 |
commit | c709a2adc052558f829d6e32eb1cb08334ee3ecf (patch) | |
tree | 34934bed08979f58c7c9fb2cb091ea8c5b3ce717 /build-aux/assert-todos.sh | |
parent | TODOs.md: Mark task-03d0e24c-4baf-404f-ac8a-f8d972ec622e as CANCELLED (diff) | |
download | remembering-c709a2adc052558f829d6e32eb1cb08334ee3ecf.tar.gz remembering-c709a2adc052558f829d6e32eb1cb08334ee3ecf.tar.xz |
Update assert-todos.sh: Enforce statuses to be in sync
Diffstat (limited to '')
-rwxr-xr-x | build-aux/assert-todos.sh | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/build-aux/assert-todos.sh b/build-aux/assert-todos.sh index 0b0a8d6..fea8395 100755 --- a/build-aux/assert-todos.sh +++ b/build-aux/assert-todos.sh @@ -9,26 +9,49 @@ fi awk -F'{#' ' BEGIN { - status=0 - idx=0 + 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 +} + /^## / { if (match($0, / \{#.*?\}$/) == 0) { print "Missing ID for line " NR ":\n" $0 - status=1 + 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 - status=1 + exitstatus = 1 } else { arr[id] = 1 } + + split($0, l, " ") + h2status = l[2] + h2flag = 1 + prevline = $0 } + + /^# Improvements$/ { - exit status + exit exitstatus } ' TODOs.md |