Skip to content

Commit

Permalink
Fix changelog generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ungive committed Sep 3, 2024
1 parent 1ac44b9 commit c00cfa1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions scripts/fix-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@

for line in sys.stdin:
if len(line.strip()) == 0:
state = DEFAULT
print()
print()
continue
is_bullet_start = line.lstrip()[0] in ('-', '*', '+')
is_bullet_start = line.lstrip()[0] in ('-', '*', '+') \
and line.lstrip()[1] not in ('-', '*', '+')
# print((is_bullet_start, line))
if state == BULLET and not is_bullet_start:
if not linebreak:
print(' ', end='')
Expand All @@ -28,4 +32,4 @@
print(line.rstrip() + (' ' if linebreak else ''), end=('\n' if linebreak else ''))
else:
state = DEFAULT
print(line)
print(line.rstrip() + ' ', end='')
2 changes: 1 addition & 1 deletion scripts/generate-release-changelog
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VERSION=$1
cd $(dirname $0)

mkdir -p out
sed "/^## $VERSION$/,/^## /!d;//d;/^$/d" ../CHANGELOG.md > out/tmp.txt
sed "/^## $VERSION$/,/^## /!d;//d" ../CHANGELOG.md > out/tmp.txt
cat out/tmp.txt | python3 fix-changelog.py > out/tmp2.txt
cp release-changelog.template.md out/changelog.md
sed -e '/`insert:changelog`/ {' -e 'r out/tmp2.txt' -e 'd' -e '}' -i out/changelog.md
Expand Down

0 comments on commit c00cfa1

Please sign in to comment.