ci(lint): add ASCII character check using ripgrep#814
Conversation
Adds a lint job that flags non-ASCII characters (em-dashes, en-dashes, curly quotes, emoji, etc.) which render poorly in terminals. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
rg was not installed on ubuntu-latest runners, and the if-guard silently swallowed the command-not-found error. Capture the exit code explicitly: 0 means matches found (fail), 1 means clean (pass), anything else (including 127 command-not-found) propagates as a failure. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GitHub Actions defaults to bash -e which kills the script before
capturing the exit code. Use bash {0} (no -e) so rg prints its
findings before the step fails.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace em-dashes, en-dashes, arrows, curly quotes, emoji, box-drawing characters, and other non-ASCII content with terminal-safe ASCII across 60 files. Also exclude vendored .min.js from the ascii-check CI job. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Also remove the *.html exclusion from the ascii-check CI glob since all HTML files are now clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace prompt symbols and strip replacement characters from device serial output. Remove the *.cast exclusion from the CI glob. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Why do we hate UTF8? :D I loved when we got free of the ASCII limitations |
|
until your yaml depends on it |
|
@raballew Humm, I get the idea behind this, but I think this is a lot of changes to merge just for a character transition. One of the nice things about languages such as Python, Rust, and Go is the ability to incorporate UTF-8 characters into comments and logs, for example, adding emojis to rich log outputs. So therefore, I think we can apply this, but limit the file types if applies to or the domains we enforce this in. |
Summary
ascii-checkjob to the lint workflow that usesrg '[^\p{ASCII}]'to flag non-ASCII characters (em-dashes, en-dashes, curly quotes, emoji, etc.) that render poorly or break in terminals.castand.htmlfiles which legitimately contain non-ASCII contentTest plan
ascii-checkjob runs in CI (it will fail on existing violations -- expected)🤖 Generated with Claude Code