Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Each Pull Request usually has a changelog file that describes the changes made i
Changelog files are placed in the `changelog/` directory and used to generate the Release Notes for the
upcoming release. Preview of the Release Notes is automatically added as comment to each Pull Request.
The changelog file needs to follow the naming convention
`YYYYMMDD-<change_kind>-<short-description>.md`. To create changelog file please use the
`YYYYMMDD-<change_kind>-<short-title>.md`. To create changelog file please use the
`scripts/release/create_changelog.py` script. Example usage:

```console
Expand All @@ -34,7 +34,7 @@ usage: create_changelog.py [-h] [-c ] [-d ] [-e] -k title
Utility to easily create a new changelog entry file.

positional arguments:
title Title for the changelog entry
title Title used in changelog filename and passed as initial file contents

options:
-h, --help show this help message and exit
Expand Down
5 changes: 2 additions & 3 deletions scripts/release/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ def from_str(kind_str: str) -> "ChangeKind":


class ChangeEntry:
def __init__(self, date: datetime, kind: ChangeKind, title: str, contents: str):
def __init__(self, date: datetime, kind: ChangeKind, contents: str):
self.date = date
self.kind = kind
self.title = title
self.contents = contents


Expand Down Expand Up @@ -129,7 +128,7 @@ def extract_changelog_entry_from_contents(file_contents: str) -> ChangeEntry:
## Add newline to contents so the Markdown file also contains a newline at the end
contents = data.content + "\n"

return ChangeEntry(date=date, title=str(data["title"]), kind=kind, contents=contents)
return ChangeEntry(date=date, kind=kind, contents=contents)


def get_changelog_filename(title: str, kind: ChangeKind, date: datetime) -> str:
Expand Down
4 changes: 2 additions & 2 deletions scripts/release/create_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
- '{str(ChangeKind.FIX)}' for bugfix entries
- '{str(ChangeKind.OTHER)}' for other entries""",
)
parser.add_argument("title", type=str, help="Title for the changelog entry")
parser.add_argument("title", type=str, help="Title used in changelog filename and passed as initial file contents")
args = parser.parse_args()

title = args.title
Expand All @@ -72,10 +72,10 @@
with open(changelog_path, "w") as f:
# Add frontmatter based on args
f.write("---\n")
f.write(f"title: {title}\n")
f.write(f"kind: {str(kind)}\n")
f.write(f"date: {date_str}\n")
f.write("---\n\n")
f.write(f"* {title}\n")

if args.editor:
editor = os.environ.get("EDITOR", "vi") # Fallback to vim if EDITOR is not set
Expand Down
1 change: 0 additions & 1 deletion scripts/release/tests/changelog_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ def test_strip_changelog_entry_frontmatter():

change_entry = extract_changelog_entry_from_contents(file_contents)

assert change_entry.title == "This is my change"
assert change_entry.kind == ChangeKind.FEATURE
assert change_entry.date == datetime.date(2025, 7, 10)
assert (
Expand Down