You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
critcheck counts a malformed grep pattern as a failure on macOS (BSD grep error wording) #190
On macOS a grep acceptance criterion with a malformed regular expression is counted as a real failure instead of "not counted", because macOS's BSD grep words its errors differently from GNU grep. go/internal/critcheckTestAMalformedCheckWithNoRepairIsNotCounted fails on macOS on main (critcheck_test.go:114: findings = []) and passes on Linux.
Replication
On a Mac: cd go && go test ./internal/critcheck -run TestAMalformedCheckWithNoRepairIsNotCounted -count=1 -v. By hand: echo x | grep -E 'Checksum(' prints grep: parentheses not balanced (exit 2) with BSD grep.
Where
Malformed() (go/internal/critcheck/critcheck.go) matches GNU's regex error wording ("Unmatched …", "Invalid …", "Trailing backslash"). BSD grep says "parentheses not balanced", "brackets ([ ]) not balanced" and lowercase "trailing backslash". Option errors ("unrecognized option") are already caught.
The fix
Recognise the BSD grep regex error messages alongside the GNU ones.
Acceptance
On macOS and Linux, a criterion whose grep pattern is malformed is reported as not counted, and the existing test passes on both.
Activity
AbirAbbas commentedon Nov 16, 2026
Duplicate of #192, which has the fuller write-up. Filed twice by mistake during the 2026-11-13 macOS check (PR #194 references both).