jumanjihouse / pre-commit-hooks

git pre-commit hooks that work with http://pre-commit.com/
MIT License
114 stars 52 forks source link

consider filter/replace for unicode chars #62

Open jumanjiman opened 4 years ago

jumanjiman commented 4 years ago

The require-ascii hook fails if it detects unicode.

Current: it makes best-effort to show the offending character along with column/line number. example:

path/to/filename: line 1773 column 39 character "’" (decimal 8217)

Consider: Add option to automatically replace (rewrite) offending characters with ascii equivalent. e.g., replace unicode 8217 with ascii apostrophe.