-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: filter release notes to useful categories (#16)
- Loading branch information
1 parent
297d858
commit 10b76b9
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{%- macro render_type_commits(type_commits) -%} | ||
{%- for type_ in ("breaking", "feature", "performance", "fix", "documentation") -%} | ||
{%- if type_ in type_commits %} | ||
### {{ type_ | capitalize }} | ||
{% for commit in type_commits[type_] %} | ||
* {{ commit["descriptions"][0] }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})) | ||
{% set ns = namespace(skip_line=false) -%} | ||
{%- for line in commit["descriptions"][1:] -%} | ||
{# skip co-author annotations in commit messages and internal notes #} | ||
{%- if "---------" in line -%} | ||
{%- set ns.skip_line = true -%} | ||
{%- elif not ns.skip_line %} | ||
{{ line | indent(2, first=True, blank=True)}} | ||
{% endif -%} | ||
{%- endfor %} | ||
{%- endfor -%} | ||
{%- endif %} | ||
{%- endfor -%} | ||
{%- endmacro -%} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% import '.macros.j2' as macros -%} | ||
# {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }}) | ||
{{ macros.render_type_commits(release["elements"]) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% import '.macros.j2' as macros -%} | ||
# CHANGELOG | ||
{%- if context.history.unreleased | length > 0 %} | ||
## Unreleased | ||
{{ macros.render_type_commits(context.history.unreleased) }} | ||
{%- endif %} | ||
{%- for version, release in context.history.released.items() %} | ||
## {{ version.as_semver_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }}) | ||
{{ macros.render_type_commits(release["elements"]) }} | ||
{%- endfor %} |