Skip to content

Commit d4515e4

Browse files
hamdanalwesleywright
authored andcommitted
Fix a few PR links in the changelog (#18586)
And add a local pre-commit hook to detect when a PR number in a link text is different from the link body
1 parent f83b643 commit d4515e4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ repos:
3939
rev: v1.0.1
4040
hooks:
4141
- id: zizmor
42+
- repo: local
43+
hooks:
44+
- id: bad-pr-link
45+
name: Bad PR link
46+
description: Detect PR links text that don't match their URL
47+
language: pygrep
48+
entry: '\[(\d+)\]\(https://github.com/python/mypy/pull/(?!\1/?\))\d+/?\)'
49+
files: CHANGELOG.md
4250
# Should be the last one:
4351
- repo: meta
4452
hooks:

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ By default, mypy treats an annotation of ``bytes`` as permitting ``bytearray`` a
2626
[PEP 688](https://peps.python.org/pep-0688) specified the removal of this special case.
2727
Use this flag to disable this behavior. `--strict-bytes` will be enabled by default in **mypy 2.0**.
2828

29-
Contributed by Ali Hamdan (PR [18137](https://github.com/python/mypy/pull/18263/)) and
29+
Contributed by Ali Hamdan (PR [18263](https://github.com/python/mypy/pull/18263)) and
3030
Shantanu Jain (PR [13952](https://github.com/python/mypy/pull/13952)).
3131

3232
### Improvements to reachability analysis and partial type handling in loops
@@ -36,7 +36,7 @@ issues it previously did not detect. In some cases, this change may require use
3636
explicit annotation of a variable.
3737

3838
Contributed by Christoph Tyralla (PR [18180](https://github.com/python/mypy/pull/18180),
39-
[PR](https://github.com/python/mypy/pull/18433)).
39+
PR [18433](https://github.com/python/mypy/pull/18433)).
4040

4141
(Speaking of partial types, another reminder that mypy plans on enabling `--local-partial-types`
4242
by default in **mypy 2.0**).
@@ -49,7 +49,7 @@ configuration files. See the
4949
for more details.
5050

5151
Contributed by Mikhail Shiryaev and Shantanu Jain
52-
(PR [16965](https://github.com/python/mypy/pull/16965), PR [18482](https://github.com/python/mypy/pull/18482)
52+
(PR [16965](https://github.com/python/mypy/pull/16965), PR [18482](https://github.com/python/mypy/pull/18482))
5353

5454
### Better line numbers for decorators and slice expressions
5555

0 commit comments

Comments
 (0)