From af475629d839c20c208f9fcdd4e7cd5d390d2438 Mon Sep 17 00:00:00 2001 From: A <258483684+la14-1@users.noreply.github.com> Date: Fri, 20 Feb 2026 20:36:47 -0800 Subject: [PATCH] fix: exclude echo -n from macos-compat MC002 rule to eliminate false positives (#1545) The MC002 regex matched both `echo -e` and `echo -n`, but only `echo -e` is non-portable on macOS bash 3.2. `echo -n` works fine as a bash builtin. This caused 3 false positive errors (all TTY probe patterns using `echo -n "" > /dev/tty`) making the linter exit non-zero incorrectly. Agent: test-engineer Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 --- test/macos-compat.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/macos-compat.sh b/test/macos-compat.sh index 0535f950..6c7acfb1 100755 --- a/test/macos-compat.sh +++ b/test/macos-compat.sh @@ -98,7 +98,7 @@ while IFS= read -r _f; do _mc002_msg="'echo" _mc002_msg="${_mc002_msg} -e' is not portable — use printf instead" grep_rule "error" "MC002" "$_mc002_msg" \ - "$_f" "$_r" 'echo[[:space:]]+-[en]+[[:space:]]' + "$_f" "$_r" 'echo[[:space:]]+-[en]*e[en]*[[:space:]]' # MC003: source <(...) or . <(...) grep_rule "error" "MC003" "'source <(...)' fails in bash <(curl...) — use eval instead" \