Lint: Allow per-message Post-History links w/trailing slash (#3005)
* Lint: Only ignore per-message links in Post-History with trailing slash * PEP 684: Add trailing slash to per-message Post-History link * Infra: Use clearer term (message, not post) for single Discourse messages
This commit is contained in:
parent
bb50330507
commit
f292166dba
|
@ -223,7 +223,7 @@ repos:
|
||||||
- id: validate-post-history
|
- id: validate-post-history
|
||||||
name: "'Post-History' must be '`DD-mmm-YYYY <Thread URL>`__, ...'"
|
name: "'Post-History' must be '`DD-mmm-YYYY <Thread URL>`__, ...'"
|
||||||
language: pygrep
|
language: pygrep
|
||||||
entry: '(?<=\n)Post-History:(?:(?! ?\n|((( +|\n {1,14})(([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])|`([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9]) <https://((discuss\.python\.org/t/([\w\-]+/)?\d+(?:/\d+)?/?)|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))>`__)(,|(?=\n[^ ])))+\n(?=[A-Z\n]))))'
|
entry: '(?<=\n)Post-History:(?:(?! ?\n|((( +|\n {1,14})(([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9])|`([0-2][0-9]|(3[01]))-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(199[0-9]|20[0-9][0-9]) <https://((discuss\.python\.org/t/([\w\-]+/)?\d+(?:/\d+/|/?))|(mail\.python\.org/pipermail/[\w\-]+/\d{4}-[A-Za-z]+/[A-Za-z0-9]+\.html)|(mail\.python\.org/archives/list/[\w\-]+@python\.org/thread/[A-Za-z0-9]+/?(#[A-Za-z0-9]+)?))>`__)(,|(?=\n[^ ])))+\n(?=[A-Z\n]))))'
|
||||||
args: [--multiline]
|
args: [--multiline]
|
||||||
files: '^pep-\d+\.(rst|txt)$'
|
files: '^pep-\d+\.(rst|txt)$'
|
||||||
types: [text]
|
types: [text]
|
||||||
|
|
|
@ -10,7 +10,7 @@ Created: 08-Mar-2022
|
||||||
Python-Version: 3.12
|
Python-Version: 3.12
|
||||||
Post-History: `08-Mar-2022 <https://mail.python.org/archives/list/python-dev@python.org/thread/CF7B7FMACFYDAHU6NPBEVEY6TOSGICXU/>`__,
|
Post-History: `08-Mar-2022 <https://mail.python.org/archives/list/python-dev@python.org/thread/CF7B7FMACFYDAHU6NPBEVEY6TOSGICXU/>`__,
|
||||||
`29-Sep-2022 <https://discuss.python.org/t/pep-684-a-per-interpreter-gil/19583>`__,
|
`29-Sep-2022 <https://discuss.python.org/t/pep-684-a-per-interpreter-gil/19583>`__,
|
||||||
`28-Oct-2022 <https://discuss.python.org/t/pep-684-a-per-interpreter-gil/19583/19>`__,
|
`28-Oct-2022 <https://discuss.python.org/t/pep-684-a-per-interpreter-gil/19583/19/>`__,
|
||||||
Resolution:
|
Resolution:
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -250,7 +250,7 @@ def _process_discourse_url(parts: list[str]) -> tuple[str, str]:
|
||||||
has_title = not first_subpart.isnumeric()
|
has_title = not first_subpart.isnumeric()
|
||||||
|
|
||||||
if "t" in parts:
|
if "t" in parts:
|
||||||
item_type = "post" if len(parts) > (5 + has_title) else "thread"
|
item_type = "message" if len(parts) > (5 + has_title) else "thread"
|
||||||
elif "c" in parts:
|
elif "c" in parts:
|
||||||
item_type = "category"
|
item_type = "category"
|
||||||
if has_title:
|
if has_title:
|
||||||
|
|
Loading…
Reference in New Issue