Add support for version description in changelog

This commit is contained in:
Ivan Habunek 2022-08-17 10:56:54 +02:00
parent 71ae2bf906
commit 8be0aba95d
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95
2 changed files with 12 additions and 1 deletions

View File

@ -21,6 +21,13 @@ for version in data.keys():
changes = data[version]["changes"] changes = data[version]["changes"]
print(f"### [{version} ({date})](https://github.com/ihabunek/twitch-dl/releases/tag/{version})") print(f"### [{version} ({date})](https://github.com/ihabunek/twitch-dl/releases/tag/{version})")
print() print()
if "description" in data[version]:
description = data[version]["description"].strip()
for line in textwrap.wrap(description, 80):
print(line)
print()
for c in changes: for c in changes:
lines = textwrap.wrap(c, 78) lines = textwrap.wrap(c, 78)
initial = True initial = True

View File

@ -44,14 +44,18 @@ if dist_version != version:
release_date = changelog_item["date"] release_date = changelog_item["date"]
changes = changelog_item["changes"] changes = changelog_item["changes"]
description = changelog_item["description"] if "description" in changelog_item else None
if not isinstance(release_date, date): if not isinstance(release_date, date):
print(f"Release date not set for version `{version}` in the changelog.", file=sys.stderr) print(f"Release date not set for version `{version}` in the changelog.", file=sys.stderr)
sys.exit(1) sys.exit(1)
commit_message = f"twitch-dl {version}\n\n" commit_message = f"twitch-dl {version}\n\n"
if description:
lines = textwrap.wrap(description.strip(), 72)
commit_message += "\n".join(lines) + "\n\n"
for c in changes: for c in changes:
lines = textwrap.wrap(c, 70) lines = textwrap.wrap(c, 69)
initial = True initial = True
for line in lines: for line in lines:
lead = " *" if initial else " " lead = " *" if initial else " "