Skip to content

Lint reStructuredText prose with Vale to ban em dashes - #2428

Merged
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/vale-ban-em-dashes
Aug 6, 2026
Merged

Lint reStructuredText prose with Vale to ban em dashes#2428
adamtheturtle merged 2 commits into
mainfrom
adamtheturtle/vale-ban-em-dashes

Conversation

@adamtheturtle

Copy link
Copy Markdown
Member

Adds Vale as a pre-commit hook so em dashes cannot creep into our reStructuredText.

The rules come from the pinned ClearProse style package (v1.1.0) rather than a hand-written local rule, configured in a new .vale.ini; vale sync downloads it into a gitignored styles/ directory before the lint runs. That release ships as a Vale config package, so it carries the TokenIgnores pattern that keeps Sphinx role targets such as :ref: out of the prose check. vale==3.13.0.0 is pinned in the dev extra, and .vale.ini is added to the check-manifest ignores.

Verified locally: vale reports no alerts across the tracked .rst files, and prek run over the changed files passes.

Note that the vale PyPI wrapper is behind the upstream binary (3.13.0 against 3.17.1), and 3.13.0 drops the occasional alert: on the ClearProse fixture with seven em dashes it reports six, where 3.17.1 reports all seven. The ban still holds, because a file with an em dash is still reported, but the pin is worth bumping when the wrapper publishes a newer Vale.

🤖 Generated with Claude Code

Ban em dashes in reStructuredText using the pinned ClearProse Vale style
package.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Gating ``vale sync`` on reStructuredText files alone meant a commit that
only bumped the pinned ClearProse package left the gitignored ``styles``
directory on the old rules until the next reStructuredText change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@adamtheturtle
adamtheturtle merged commit ab42da8 into main Aug 6, 2026
15 checks passed
@adamtheturtle
adamtheturtle deleted the adamtheturtle/vale-ban-em-dashes branch August 6, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant