🧪 Lint for typos in `:user:` RST role

It is easy to forget backticks in change note bylines. It's happened
in #12531 already, requiring a hotfix in #12560.

The pre-commit based check idea is coming from the Tox project and
have been battle-tested in aiohttp, CherryPy, and other ecosystems.
This commit is contained in:
Sviatoslav Sydorenko 2024-07-02 15:21:24 +02:00
parent 51ee3880c7
commit 9c319d6605
No known key found for this signature in database
GPG Key ID: 9345E8FEA89CA455
1 changed files with 8 additions and 0 deletions

View File

@ -102,6 +102,14 @@ repos:
) )
$ $
files: ^changelog/ files: ^changelog/
- id: changelogs-user-role
name: Changelog files should use a non-broken :user:`name` role
language: pygrep
entry: :user:([^`]+`?|`[^`]+[\s,])
pass_filenames: true
types:
- file
- rst
- id: py-deprecated - id: py-deprecated
name: py library is deprecated name: py library is deprecated
language: pygrep language: pygrep