Skip to content

Commit

Permalink
add meta comment below every version entry of the changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
brainelectronics committed Oct 4, 2024
1 parent d0aa709 commit 37a58ad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .snippets/16.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Add comment with meta data below every changelog entry
<!--
type: feature
scope: all
affected: all
-->

- add comment with meta data below every changelog entry for later parsing, closes #16
- update `README` badge to show support for Python 3.9 - 3.11 instead of generic Python 3
5 changes: 5 additions & 0 deletions snippets2changelog/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ def update_changelog(self) -> None:
changelog_entry_content = {
"version": self.semver_data,
"timestamp": commit.committed_datetime.isoformat(),
"meta": {
"type": snippet_content["type"],
"scope": snippet_content["scope"],
"affected": snippet_content["affected"],
},
"content": snippet_content["details"],
"version_reference": f"https://github.com/brainelectronics/snippets2changelog/tree/{self.semver_data}",
}
Expand Down
3 changes: 3 additions & 0 deletions snippets2changelog/templates/changelog_part.md.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## [{{ version }}] - {{ timestamp }}
{%- if meta %}
<!-- meta = {{ meta }} -->
{%- endif %}
{{- content }}
[{{ version }}]: {{ version_reference }}

0 comments on commit 37a58ad

Please sign in to comment.