Skip to content

Commit

Permalink
Fix TTLApp#1027: Avoid update-changelog to generate an extra line whe…
Browse files Browse the repository at this point in the history
…n there are no changes
  • Loading branch information
araujoarthur0 committed Nov 1, 2023
1 parent 4fdbbed commit 8149940
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/update-changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ def get_updated_file_content(current_changelog_lines: str, new_change: any, new_
if line == g_end_changes:
is_sourcing_changes = False
new_file_content.extend(get_sorted_unique_entries(changes))
# adds an extra item to avoid issues with the linter
new_file_content.append('')
# adds an extra item to avoid issues with the linter, but only if there is at least one entry
if new_file_content[-1] != '':
new_file_content.append('')

if line == g_end_users:
is_sourcing_users = False
Expand All @@ -68,6 +69,7 @@ def get_updated_file_content(current_changelog_lines: str, new_change: any, new_

# Include on extra empty line to comply with markdown formatter
new_file_content.append('')

return new_file_content

def update_changelog(changelog_filename: str, new_change: any, new_user: any):
Expand Down

0 comments on commit 8149940

Please sign in to comment.