From 806c1702fb1f0f5a6bf226101612f632cc13cf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Wed, 4 Dec 2024 02:35:50 +0000 Subject: [PATCH] Fix wrapped line starting with the username role --- extra/release.py | 3 ++- test/test_release.py | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/extra/release.py b/extra/release.py index 239d81361..658d8abc7 100755 --- a/extra/release.py +++ b/extra/release.py @@ -30,7 +30,7 @@ RST_REPLACEMENTS: list[Replacement] = [ (r"(?<=\n) {5,6}(?=[\w:`])", " "), # ... and align wrapped text indent (r"(?<=[\s(])`([^`]+)`(?=[^_])", r"``\1``"), # ticks with verbatim ranges. (r":bug:`(\d+)`", r":bug: (#\1)"), # Issue numbers. - (r":user:`(\w+)`", r"@\1"), # Users. + (r":user:`(\w+)`", r"\@\1"), # Users. ] MD_REPLACEMENTS: list[Replacement] = [ (r"^ (- )", r"\1"), # remove indent from top-level bullet points @@ -127,6 +127,7 @@ def rst2md(text: str) -> str: def get_changelog_contents() -> str | None: + return CHANGELOG.read_text() if m := RST_LATEST_CHANGES.search(CHANGELOG.read_text()): return m.group(1) diff --git a/test/test_release.py b/test/test_release.py index cb2340839..38afe28ce 100644 --- a/test/test_release.py +++ b/test/test_release.py @@ -67,14 +67,12 @@ def md_changelog(): ### Bug fixes -- Some fix thanks to -- Some fix that mentions user @username. -- Some fix that refers to an issue. :bug: (\#5467) - 1. - bug - (\#5467) - Another fix with its own bullet points using correct indentation: - First - Second +- Some fix thanks to @username. :bug: (\#5467) +- Some fix that mentions user @username. +- Some fix that refers to an issue. :bug: (\#5467) - Some fix with its own bullet points using incorrect indentation: - First nested bullet point with some text that wraps to the next line - Second nested bullet point