Skip to content

Commit

Permalink
Fix a few PR links in the changelog (#18586)
Browse files Browse the repository at this point in the history
And add a local pre-commit hook to detect when a PR number in a link
text is different from the link body
  • Loading branch information
hamdanal authored and wesleywright committed Feb 5, 2025
1 parent f83b643 commit d4515e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ repos:
rev: v1.0.1
hooks:
- id: zizmor
- repo: local
hooks:
- id: bad-pr-link
name: Bad PR link
description: Detect PR links text that don't match their URL
language: pygrep
entry: '\[(\d+)\]\(https://github.com/python/mypy/pull/(?!\1/?\))\d+/?\)'
files: CHANGELOG.md
# Should be the last one:
- repo: meta
hooks:
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ By default, mypy treats an annotation of ``bytes`` as permitting ``bytearray`` a
[PEP 688](https://peps.python.org/pep-0688) specified the removal of this special case.
Use this flag to disable this behavior. `--strict-bytes` will be enabled by default in **mypy 2.0**.

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

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

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

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

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

### Better line numbers for decorators and slice expressions

Expand Down

0 comments on commit d4515e4

Please sign in to comment.