Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add meta data as comment #17

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# snippets2changelog specific
changelog.md.new

# changelog2version specific
changelog.json

# custom, package specific ignores
.DS_Store
.DS_Store?
Expand Down
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Downloads](https://pepy.tech/badge/snippets2changelog)](https://pepy.tech/project/snippets2changelog)
![Release](https://img.shields.io/github/v/release/brainelectronics/snippets2changelog?include_prereleases&color=success)
![Python](https://img.shields.io/badge/python3-Ok-green.svg)
![Python](https://img.shields.io/badge/Python-3.9%20|%203.10%20|%203.11-green.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![codecov](https://codecov.io/github/brainelectronics/snippets2changelog/branch/main/graph/badge.svg)](https://app.codecov.io/github/brainelectronics/snippets2changelog)

Expand Down
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 }}

Loading