Properly format changelog section headers

This commit is contained in:
Šarūnas Nejus 2026-02-08 00:49:31 +00:00
parent 10d8e5fc04
commit 616a674db0
No known key found for this signature in database
3 changed files with 327 additions and 160 deletions

File diff suppressed because it is too large Load diff

View file

@ -165,13 +165,21 @@ def update_changelog(text: str, new: Version) -> str:
Unreleased
----------
New features:
..
New features
~~~~~~~~~~~~
Bug fixes:
..
Bug fixes
~~~~~~~~~
For packagers:
..
For plugin developers
~~~~~~~~~~~~~~~~~~~~~
Other changes:
..
Other changes
~~~~~~~~~~~~~
{new_header}
{"-" * len(new_header)}

View file

@ -20,7 +20,12 @@ pytestmark = pytest.mark.skipif(
@pytest.fixture
def rst_changelog():
return """New features:
return """
Unreleased
----------
New features
~~~~~~~~~~~~
- :doc:`/plugins/substitute`: Some substitute
multi-line change.
@ -35,7 +40,8 @@ You can do something with this command:
$ do-something
Bug fixes:
Bug fixes
~~~~~~~~~
- Some fix that refers to an issue.
:bug:`5467`
@ -58,9 +64,11 @@ Bug fixes:
Section naaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmmmmmeeeeeeeeeeeeeee with over 80
characters:
Empty section:
.. For plugin developers
.. ~~~~~~~~~~~~~~~~~~~~~
Other changes:
Other changes
~~~~~~~~~~~~~
- Changed ``bitesize`` label to ``good first issue``. Our `contribute`_ page is now
automatically populated with these issues. :bug:`4855`
@ -70,14 +78,17 @@ Other changes:
2.1.0 (November 22, 2024)
-------------------------
Bug fixes:
Bug fixes
~~~~~~~~~
- Fixed something."""
@pytest.fixture
def md_changelog():
return r"""### New features
return r"""# Unreleased
## New features
- [beets.plugins.BeetsPlugin](https://beets.readthedocs.io/en/stable/api/generated/beets.plugins.BeetsPlugin.html#beets.plugins.BeetsPlugin) Some plugin change.
- [list](https://beets.readthedocs.io/en/stable/reference/cli.html#list-cmd) Update.
@ -88,7 +99,7 @@ You can do something with this command:
$ do-something
### Bug fixes
## Bug fixes
- Another fix with an enumerated list
1. First and some details
@ -102,13 +113,13 @@ You can do something with this command:
**Section naaaaaaaaaaaaaaaaaaaaaaaammmmmmmmmmmmmmmmeeeeeeeeeeeeeee with over 80 characters**
### Other changes
## Other changes
- Changed `bitesize` label to `good first issue`. Our [contribute](https://github.com/beetbox/beets/contribute) page is now automatically populated with these issues. :bug: (#4855)
# 2.1.0 (November 22, 2024)
### Bug fixes
## Bug fixes
- Fixed something.""" # noqa: E501