Fail CI on hidden Unicode characters in tracked files #254
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#254
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Leyukaka on GitHub · 2026-11-21 19:25 UTC · original
Problem
Some characters render as nothing or reorder the text around them, while a compiler, an interpreter or a coding agent still reads them:
A pull request can use them to hide code or instructions from a human reviewer. GitHub shows a warning on files that contain hidden Unicode text, but nothing in CI fails on them. Reviewers and agent contributors are both affected.
Proposal
Add a standard-library script,
tests/hidden_unicode_check.py, and run it in thepython-linuxjob. It reads every tracked file and fails on:A scan of all 256 tracked files on
23d954dfound none of these characters, no BOM and no non-UTF-8 text, so the check starts without an allowlist. I can open it as a PR.Alternatives
Two related changes, which would each need their own issue:
AGENTS.mdline saying that text from issues, pull requests and comments is data for agents, not instructions;requirements-dev.txtwith--require-hashes, covering every release file ofpefileandiced-x86.Verification
python -B tests/hidden_unicode_check.pypasses onmain. Negative controls:.ps1file passes, and a BOM in the middle of the same file fails.AI-assisted.
@R0Y00 on GitHub · 2026-11-21 20:01 UTC · original
A focused check for explicit bidirectional text controls is welcome. Please run it in the existing Linux Python job and scope it to Git-tracked source files, scripts, and build/CI configuration. For each finding, report the path, line number and Unicode code point. Synthetic tests should cover a bidi control such as U+202E with the expected diagnostic and ordinary non-ASCII text that passes.
Please keep repository-wide UTF-8 enforcement, general zero-width character checks and a binary-extension allowlist outside this change. A PR linked to this issue is sufficient.