From 9c319d6605683e2236c2d6261386b544dfcbfda8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 2 Jul 2024 15:21:24 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20Lint=20for=20typos=20in=20`:user?= =?UTF-8?q?:`=20RST=20role?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56d9a0c86..431b21f99 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -102,6 +102,14 @@ repos: ) $ 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 name: py library is deprecated language: pygrep