diff options
-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 |