From 9c319d6605683e2236c2d6261386b544dfcbfda8 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 2 Jul 2024 15:21:24 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A7=AA=20Lint=20for=20typos=20in=20`:?= =?UTF-8?q?user:`=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 From 57fe9f53c64cd9bb127f650774d337a7f82f1445 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 2 Jul 2024 15:26:35 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9D=20Add=20a=20change=20note=20fo?= =?UTF-8?q?r=20PR=20#12562?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog/12562.contrib.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelog/12562.contrib.rst diff --git a/changelog/12562.contrib.rst b/changelog/12562.contrib.rst new file mode 100644 index 000000000..0d3049598 --- /dev/null +++ b/changelog/12562.contrib.rst @@ -0,0 +1,2 @@ +Possible typos in using the ``:user:`` RST role is now being linted +through the pre-commit tool integration -- by :user:`webknjaz`.