Skip to content

Commit

Permalink
✏️ Better changelog
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed Jun 18, 2024
1 parent d4d8198 commit 6f3f525
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
7 changes: 7 additions & 0 deletions templates/.release_notes.md.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## What's Changed
{% for type_, commits in release["elements"] | dictsort %}
{% include 'parsed_commit_heading.j2' %}
{%- if type_ != "unknown" %}
{% for commit in commits %}
* {{ commit.descriptions[0] }} by {{commit.commit.author.name}} in [`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})
{%- endfor %}{% endif %}{% endfor %}
4 changes: 2 additions & 2 deletions templates/CHANGELOG.md.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{#- UNRELEASED -#}
## Unreleased
{% for type_, commits in context.history.unreleased | dictsort %}
### {{ type_ | capitalize }}
{% for commit in commits %}{% if type_ != "unknown" %}
{% include 'parsed_commit_heading.j2' %}
* {{ commit.commit.message.rstrip() }} ([`{{ commit.commit.hexsha[:7] }}`]({{ commit.commit.hexsha | commit_hash_url }}))
{% else %}
* {{ commit.commit.message.rstrip() }} ([`{{ commit.commit.hexsha[:7] }}`]({{ commit.commit.hexsha | commit_hash_url }}))
Expand All @@ -16,7 +16,7 @@
{% for version, release in context.history.released.items() %}
## {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }})
{% for type_, commits in release["elements"] | dictsort %}
### {{ type_ | capitalize }}
{% include 'parsed_commit_heading.j2' %}
{% for commit in commits %}{% if type_ != "unknown" %}
* {{ commit.commit.message.rstrip() }} ([`{{ commit.commit.hexsha[:7] }}`]({{ commit.commit.hexsha | commit_hash_url }}))
{% else %}
Expand Down
39 changes: 39 additions & 0 deletions templates/parsed_commit_heading.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{%- if type_ in [':bug:', 'BUG', 'fix'] %}
### :bug: Fixed Bugs
{%- elif type_ in [':memo:', 'DOC', 'docs'] %}
### :memo: Updated Documentation
{%- elif type_ in [':sparkles:', 'FEAT', 'feat'] %}
### :sparkles: Implemented Features
{%- elif type_ in [':zap:', 'BENCH', 'perf'] %}
### :sparkles: Improved Performance
{%- elif type_ in [':construction_worker:', 'BLD', 'ci'] %}
### :construction_worker: Updated Continuous Integration
{%- elif type_ in [':ambulance:'] %}
### :ambulance: Hotfixed Issues
{%- elif type_ in [':fire:'] %}
### :fire: Deleted Code or Files
{%- elif type_ in [':pencil2:'] %}
### :pencil2: Corrected Typos
{%- elif type_ in [':pushpin:'] %}
### :pushpin: Pinned Dependencies
{%- elif type_ in [':arrow_up:'] %}
### :arrow_up: Upgraded Dependencies
{%- elif type_ in [':arrow_down:'] %}
### :arrow_down: Downgraded Dependencies
{%- elif type_ in [':heavy_plus_sign:'] %}
### :heavy_plus_sign: Added Dependencies
{%- elif type_ in [':heavy_minus_sign:'] %}
### :heavy_minus_sign: Removed Dependencies
{%- elif type_ in [':children_crossing:'] %}
### :children_crossing: Improved Usability
{%- elif type_ in [':rotating_light:'] %}
### :rotating_light: Ran Linters
{%- elif type_ in [':hammer:'] %}
### :hammer: Updated Scripts
{%- elif type_ in [':wrench:'] %}
### :hammer: Updated Configuration
{%- elif type_ in [':wastebasket:'] %}
### :wastebasket: Deprecated Code
{%- else %}
### {{ type_ | capitalize }}
{% endif %}

0 comments on commit 6f3f525

Please sign in to comment.