Skip to content

Commit

Permalink
Fix #1027: Avoid update-changelog to generate an extra line when ther…
Browse files Browse the repository at this point in the history
…e are no changes
  • Loading branch information
araujoarthur0 committed Nov 1, 2023
1 parent 0e3310e commit 694ec05
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

<!--- Begin changes - Do not remove -->


<!--- End changes - Do not remove -->

Who built 3.0.1:
Expand Down
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 694ec05

Please sign in to comment.