-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5446db
commit 9d87eae
Showing
4 changed files
with
29 additions
and
21 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
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 skip_line = false -%} | ||
{%- for line in commit["descriptions"][1:] -%} | ||
{# skip co-author annotations in commit messages #} | ||
{%- if "Co-authored-by:" in line -%} | ||
{%- set skip_line = true -%} | ||
{%- elif not 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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
{% import '.macros.j2' as macros -%} | ||
# {{ version.as_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }}) | ||
{% for type_, commits in release["elements"] | dictsort %}{% if type_ in ("feature", "fix", "performance") %} | ||
## {{ type_ | capitalize }} | ||
{% for commit in commits %} | ||
* {{ commit["descriptions"][0] | indent(2)}} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})) | ||
{% endfor %}{% endif %}{% endfor %} | ||
{{ 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 |
---|---|---|
@@ -1,19 +1,10 @@ | ||
{% import '.macros.j2' as macros -%} | ||
# CHANGELOG | ||
{% if context.history.unreleased | length > 0 %} | ||
{# UNRELEASED #} | ||
{%- if context.history.unreleased | length > 0 %} | ||
## Unreleased | ||
{% for type_, commits in context.history.unreleased | dictsort %} | ||
{%- if type_ in ("feature", "fix", "performance") %} | ||
### {{ type_ | capitalize }} | ||
{% for commit in commits -%} | ||
* {{ commit["descriptions"][0].strip() | indent(2) }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})) | ||
{% endfor %}{% endif %}{% endfor %}{% endif %} | ||
{{ macros.render_type_commits(context.history.unreleased) }} | ||
{%- endif %} | ||
{%- for version, release in context.history.released.items() %} | ||
{# RELEASED #} | ||
## {{ version.as_semver_tag() }} ({{ release.tagged_date.strftime("%Y-%m-%d") }}) | ||
{% for type_, commits in release["elements"] | dictsort %} | ||
{%- if type_ in ("feature", "fix", "performance") %} | ||
### {{ type_ | capitalize }} | ||
{% for commit in commits %} | ||
* {{ commit["descriptions"][0].strip() | indent(2) }} ([`{{ commit.short_hash }}`]({{ commit.hexsha | commit_hash_url }})) | ||
{% endfor %}{% endif %}{% endfor %}{% endfor %} | ||
{{ macros.render_type_commits(release["elements"]) }} | ||
{% endfor %} |