From 8d9c5268ce2fd0e7dfb80b9c030aa1ecf61e23b4 Mon Sep 17 00:00:00 2001 From: Johnathan Corgan Date: Sun, 27 Sep 2026 19:35:48 +0000 Subject: [PATCH] Stop the trailing-log check reading a longer function name as a call The "if ... ; then" pattern let its \S* end inside another name, so `if text=$(read_gateway_log ...); then` counted as a status-testing call of every function named `log`, and two test harnesses' log helpers were flagged for callers they do not have. The name must now start at an identifier boundary. --- testing/check-trailing-log.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/check-trailing-log.py b/testing/check-trailing-log.py index 990dc34c..d2592167 100755 --- a/testing/check-trailing-log.py +++ b/testing/check-trailing-log.py @@ -132,7 +132,9 @@ def status_tested(name: str, all_text: str, defining_file: Path) -> list[str]: (rf"^\s*{re.escape(name)}\s*\|\|", " ||"), (rf"^\s*{re.escape(name)}\s+[^\n|&]*&&", " &&"), (rf"^\s*{re.escape(name)}\s*&&", " &&"), - (rf"\bif\s+\S*\s*{re.escape(name)}\b.*;\s*then", "if ... ; then"), + # The lookbehind keeps `\S*` from ending inside a longer name, so + # `if text=$(read_gateway_log ...); then` is not read as a call of `log`. + (rf"\bif\s+\S*\s*(? ; then"), # Command substitution. Found 2026-07-23 while fixing a function this # check reported clean: `total=$(count_log_pattern "$p") || { ... }` # consumes the status, but the line begins with the variable, so none