Skip to content

Commit 93d201e

Browse files
committed
fix(ci): the invisible-character gate never matched anything
MEASURED 2026-08-27: this gate's pattern caught 0 OF 6 invisible-character test cases. It has never detected an NBSP, zero-width space, BOM, soft hyphen, bidi override or word joiner. ROOT CAUSE: the pattern used UTF-8 BYTE sequences (\xc2\xa0) while grep -P matches CHARACTERS. Bytes c2 a0 are ONE character U+00A0; \xc2\xa0 asks for TWO characters, U+00C2 then U+00A0, which is never present. grep -P '\xc2\xa0' -> miss grep -P '\x{a0}' -> MATCH Only \x00 worked, being single-byte in both readings. FIXED: codepoint escapes; C0 control characters \x01-\x08,\x0B,\x0C,\x0E-\x1F added (TAB/LF/CR excluded); and grep -a, without which grep skips any NUL-bearing file as binary. The C0 range matters: a stray BACKSPACE byte made a workflow unparseable in developer-ecosystem, so it never ran, and this linter called it clean. Canonical fix: hyperpolymath/empty-linter#70. 2 file(s) here. VERIFIED: YAML re-parsed, and the corrected pattern was confirmed to catch a real NBSP before the change was kept.
1 parent 4d0faed commit 93d201e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎.github/workflows/dogfood-gate.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
# Checks for: zero-width spaces, zero-width joiners, BOM, soft hyphens,
125125
# non-breaking spaces, null bytes, and other invisible Unicode in source files.
126126
set +e
127-
PATTERNS='\xc2\xa0|\xe2\x80\x8b|\xe2\x80\x8c|\xe2\x80\x8d|\xef\xbb\xbf|\xc2\xad|\xe2\x80\x8e|\xe2\x80\x8f|\xe2\x80\xaa|\xe2\x80\xab|\xe2\x80\xac|\xe2\x80\xad|\xe2\x80\xae|\x00'
127+
PATTERNS='\x00|[\x01-\x08\x0B\x0C\x0E-\x1F]|\x{a0}|\x{ad}|\x{200b}|\x{200c}|\x{200d}|\x{200e}|\x{200f}|\x{202a}|\x{202b}|\x{202c}|\x{202d}|\x{202e}|\x{2060}|\x{feff}'
128128
find "$GITHUB_WORKSPACE" \
129129
-not -path '*/.git/*' -not -path '*/node_modules/*' \
130130
-not -path '*/.deno/*' -not -path '*/target/*' \
@@ -135,7 +135,7 @@ jobs:
135135
-o -name '*.yml' -o -name '*.yaml' -o -name '*.md' -o -name '*.adoc' \
136136
-o -name '*.idr' -o -name '*.zig' -o -name '*.v' -o -name '*.jl' \
137137
-o -name '*.gleam' -o -name '*.hs' -o -name '*.ml' -o -name '*.sh' \) \
138-
-exec grep -Prl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null
138+
-exec grep -aPrl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null
139139
EL_EXIT=$?
140140
set -e
141141

‎rescript-ecosystem/idaptik-rescript13-staging/.github/workflows/dogfood-gate.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
# Checks for: zero-width spaces, zero-width joiners, BOM, soft hyphens,
113113
# non-breaking spaces, null bytes, and other invisible Unicode in source files.
114114
set +e
115-
PATTERNS='\xc2\xa0|\xe2\x80\x8b|\xe2\x80\x8c|\xe2\x80\x8d|\xef\xbb\xbf|\xc2\xad|\xe2\x80\x8e|\xe2\x80\x8f|\xe2\x80\xaa|\xe2\x80\xab|\xe2\x80\xac|\xe2\x80\xad|\xe2\x80\xae|\x00'
115+
PATTERNS='\x00|[\x01-\x08\x0B\x0C\x0E-\x1F]|\x{a0}|\x{ad}|\x{200b}|\x{200c}|\x{200d}|\x{200e}|\x{200f}|\x{202a}|\x{202b}|\x{202c}|\x{202d}|\x{202e}|\x{2060}|\x{feff}'
116116
find "$GITHUB_WORKSPACE" \
117117
-not -path '*/.git/*' -not -path '*/node_modules/*' \
118118
-not -path '*/.deno/*' -not -path '*/target/*' \
@@ -123,7 +123,7 @@ jobs:
123123
-o -name '*.yml' -o -name '*.yaml' -o -name '*.md' -o -name '*.adoc' \
124124
-o -name '*.idr' -o -name '*.zig' -o -name '*.v' -o -name '*.jl' \
125125
-o -name '*.gleam' -o -name '*.hs' -o -name '*.ml' -o -name '*.sh' \) \
126-
-exec grep -Prl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null
126+
-exec grep -aPrl "$PATTERNS" {} \; > /tmp/empty-lint-results.txt 2>/dev/null
127127
EL_EXIT=$?
128128
set -e
129129

0 commit comments

Comments
 (0)