Skip to content

Commit

Permalink
feat: update template keepachangelog
Browse files Browse the repository at this point in the history
changes:
* capitalized commit subject
* show author name for each commit
* sort commits by date
* unique commit subject to keep notable
  • Loading branch information
rainchen committed Feb 27, 2020
1 parent 0204c7a commit ce76ed6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/git_changelog/templates/keepachangelog/commit.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- {{ commit.subject }} ([{{ commit.hash|truncate(7, True, '') }}]({{ commit.url }})).
- {{ commit.subject|capitalize }} ([{{ commit.hash|truncate(7, True, '') }}]({{ commit.url }}) by {{ commit.author_name }}).
{%- if commit.text_refs.issues_not_in_subject %} Related issues/PRs: {% for issue in commit.text_refs.issues_not_in_subject -%}
{{ issue.ref }}{% if not loop.last %}, {% endif -%}
{%- endfor -%}{%- endif -%}
2 changes: 1 addition & 1 deletion src/git_changelog/templates/keepachangelog/section.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### {{ section.type or "Misc" }}
{% for commit in section.commits|sort(attribute='subject') -%}
{% for commit in section.commits|sort(attribute='author_date',reverse=true)|unique(attribute='subject') -%}
{% include 'commit.md' with context %}
{% endfor %}

0 comments on commit ce76ed6

Please sign in to comment.