mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-06-29 06:00:45 +00:00
Add remove-em-dash hook
New fixer hook that replaces UTF-8 em-dashes (U+2014) with a plain hyphen (-), modeled on the trailing-whitespace hook. - pre_commit_hooks/remove_em_dash.py: the fixer (binary-safe, UTF-8 only) - tests/remove_em_dash_test.py: full coverage of fix and no-op cases - registered in setup.cfg, .pre-commit-hooks.yaml, and README.md Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
fa6b006f0e
commit
aba8a7597a
5 changed files with 84 additions and 0 deletions
|
|
@ -175,6 +175,11 @@ the following commandline options:
|
|||
- `--no-sort-keys` - when autofixing, retain the original key ordering (instead of sorting the keys)
|
||||
- `--top-keys comma,separated,keys` - Keys to keep at the top of mappings.
|
||||
|
||||
#### `remove-em-dash`
|
||||
Replaces em-dashes (Unicode `U+2014`) with a plain hyphen (`-`).
|
||||
- Only the UTF-8 encoding of the em-dash is replaced; files using other
|
||||
encodings are left untouched.
|
||||
|
||||
#### `requirements-txt-fixer`
|
||||
Sorts entries in requirements.txt and constraints.txt and removes incorrect entry for `pkg-resources==0.0.0`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue