Skip to content

Commit

Permalink
Fix: Change the newlines, for a correct appearance of the generated c…
Browse files Browse the repository at this point in the history
…hangelog
  • Loading branch information
y0urself committed Sep 23, 2021
1 parent 0815f2d commit 4a61087
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pontos/changelog/conventional_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def build_changelog_file(self, commit_dict: Dict):
)
if self.next_version:
changelog += (
f'## [{self.next_version}] - {date.today().isoformat()}\n\n'
f'## [{self.next_version}] - {date.today().isoformat()}\n'
)
else:
changelog += '## [Unreleased]\n\n'
Expand All @@ -126,7 +126,7 @@ def build_changelog_file(self, commit_dict: Dict):
# changelog entries
for commit_type in commit_types:
if commit_type['group'] in commit_dict.keys():
changelog += f"## {commit_type['group']}\n\n"
changelog += f"\n## {commit_type['group']}\n"
for msg in commit_dict[commit_type['group']]:
changelog += f"* {msg}\n"

Expand Down
21 changes: 10 additions & 11 deletions tests/changelog/test_conventional_commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def test_changelog_builder(self):
release_version = '0.0.2'
output = f'v{release_version}.md'
git_log = (
'1234567 Added: foo bar\n'
'8abcdef Added: bar baz\n'
'1337abc Changed: bar to baz\n'
'42a42a4 Removed: foo bar again\n'
'1234567 Add: foo bar\n'
'8abcdef Add: bar baz\n'
'1337abc Change: bar to baz\n'
'42a42a4 Remove: foo bar again\n'
'fedcba8 Test: bar baz testing\n'
'dead901 Refactor: bar baz ref\n'
'fedcba8 Fix: bar baz fixing\n'
Expand Down Expand Up @@ -80,26 +80,25 @@ def runner(cmd):
## [0.0.2] - {today}
## Added
* foo bar [1234567](https://github.com/foo/bar/commit/1234567)
* bar baz [8abcdef](https://github.com/foo/bar/commit/8abcdef)
## Removed
## Removed
* foo bar again [42a42a4](https://github.com/foo/bar/commit/42a42a4)
## Changed
## Changed
* bar to baz [1337abc](https://github.com/foo/bar/commit/1337abc)
## Bug Fixes
## Bug Fixes
* bar baz fixing [fedcba8](https://github.com/foo/bar/commit/fedcba8)
## Documentation
## Documentation
* bar baz documenting [d0c4d0c](https://github.com/foo/bar/commit/d0c4d0c)
## Refactor
## Refactor
* bar baz ref [dead901](https://github.com/foo/bar/commit/dead901)
## Testing
## Testing
* bar baz testing [fedcba8](https://github.com/foo/bar/commit/fedcba8)
[0.0.2]: https://github.com/foo/bar/compare/0.0.1...0.0.2"""
Expand Down

0 comments on commit 4a61087

Please sign in to comment.