Skip to content

Commit 9c319d6

Browse files
committed
🧪 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.
1 parent 51ee388 commit 9c319d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ repos:
102102
)
103103
$
104104
files: ^changelog/
105+
- id: changelogs-user-role
106+
name: Changelog files should use a non-broken :user:`name` role
107+
language: pygrep
108+
entry: :user:([^`]+`?|`[^`]+[\s,])
109+
pass_filenames: true
110+
types:
111+
- file
112+
- rst
105113
- id: py-deprecated
106114
name: py library is deprecated
107115
language: pygrep

0 commit comments

Comments
 (0)