Repository navigation
CI: Reject hidden Unicode characters and remove soft hyphens - #8030
Merged
echoix merged 2 commits intoOct 7, 2026
Merged
Conversation
Renovate warned about soft hyphens (U+00AD) in the i.svm.predict and i.svm.train documentation, copied from a reference title. Remove them from the .md and .html files. Add a local pygrep hook that rejects soft hyphens, zero-width characters, bidirectional controls and the byte order mark, which editorconfig-checker does not detect. Translation files are excluded because they legitimately contain some of these characters. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
ninsbl
approved these changes
Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Renovate’s dependency dashboard is showing us warnings of hidden Unicode characters. It’s finally only soft-hyphens in a citation. But to prevent something similar to being introduced, add a simple pre-commit hook that will catch those.
Description
in
i.svm.predictandi.svm.train(.mdand.htmlfiles).forbid-hidden-unicodepre-commit hook (pygrep) thatrejects soft hyphens, zero-width characters (U+200B-200F), bidirectional
controls (U+202A-202E, U+2066-2069), U+2060-2064 and the byte order mark.
locale/po/is excluded because translations legitimately contain some ofthese characters (for example Malayalam joiners).
Motivation and context
The Renovate dependency dashboard reports "Hidden Unicode characters have
been discovered in file(s) in your repository". The Renovate log names two
files,
imagery/i.svm.predict/i.svm.predict.htmlandimagery/i.svm.train/i.svm.train.html, both with ``. The characterwas a copy and paste artifact in a literature reference. The
.mdsourceshad it too.
editorconfig-checkerdoes not detect invisible characters (it checks lineendings, final newline, trailing whitespace, indentation and charset), so
nothing prevented this from being committed. The new hook closes that gap.
The hook is written as UTF-8 byte sequences because
pygrepmatches bytesand does not accept
\uescapes.How has this been tested?
pre-commit run forbid-hidden-unicode --all-filespasses on therepository after the cleanup.
U+FEFF.
(U+2010) passes, so ordinary text is not flagged.
The other pre-commit hooks were not run.
Screenshots (if appropriate)
Types of changes
functionality to not work as before)
Documentation cleanup and a new CI check.
Checklist
pre-defined prefixes
of this project.
AI disclosure
This change was prepared with the help of Claude Code. The hook regular
expression was reviewed and tested as described above.
🤖 Generated with Claude Code