Skip to content

Commit 1c80346

Browse files
TMHSDigitalclaude
andcommitted
test: keep the writing-style guard ASCII-only so it passes its own scan
The dash and emoji patterns in test_docs_hygiene.py were written as literal characters, so once the file was tracked the guard flagged itself and failed "Run drift_check tests" on main. The patterns are now built from code points with chr(). Refs #111 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent f10dd5e commit 1c80346

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎tests/test_docs_hygiene.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@
1818
# gh_summary renders status icons into the Actions step summary; they are
1919
# functional output, not prose.
2020
EMOJI_ALLOWLIST = {"scripts/drift_check/report/gh_summary.py"}
21-
EMOJI_RE = re.compile("[\U0001F300-\U0001FAFF☀-➿]")
21+
# Built from code points so this file stays pure ASCII and passes its own check.
22+
EM_DASH, EN_DASH = chr(0x2014), chr(0x2013)
23+
EMOJI_RE = re.compile("[%s-%s%s-%s]" % (chr(0x1F300), chr(0x1FAFF), chr(0x2600), chr(0x27BF)))
2224

2325

2426
def _tracked_text_files() -> list[Path]:
@@ -41,7 +43,7 @@ def test_no_em_or_en_dashes_or_emoji():
4143
rel = path.relative_to(REPO_ROOT).as_posix()
4244
text = path.read_text(encoding="utf-8", errors="replace")
4345
for lineno, line in enumerate(text.splitlines(), 1):
44-
if "—" in line or "–" in line:
46+
if EM_DASH in line or EN_DASH in line:
4547
offenders.append(f"{rel}:{lineno}: dash")
4648
if rel not in EMOJI_ALLOWLIST and EMOJI_RE.search(line):
4749
offenders.append(f"{rel}:{lineno}: emoji")

0 commit comments

Comments
 (0)