Skip to content

Commit 2de9812

Browse files
committed
fixup! chore: fix broken cliff.
1 parent bcf18e1 commit 2de9812

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

cliff.toml

+27-4
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,38 @@ Acronyms:
2222
# template for the changelog body
2323
# https://keats.github.io/tera/docs/#introduction
2424
body = """
25+
{%- macro remote_url() -%}
26+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
27+
{%- endmacro -%}
28+
2529
{% if version %}\
2630
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
2731
{% else %}\
2832
## [unreleased]
2933
{% endif %}\
30-
{% for group, commits in commits | group_by(attribute="group") %}
31-
### {{ group | striptags | trim | upper_first }}
32-
{% for commit in commits | filter(attribute="merge_commit", value=false) %}
34+
{% for group, commits in commits | unique(attribute="id") | group_by(attribute="group") %}
35+
### {{ group | upper_first }}
36+
{% for commit in commits | unique(attribute="message") %}
3337
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
3438
{% if commit.breaking %}[**breaking**] {% endif %}\
3539
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/BITNP/BIThesis/commit/{{ commit.id }}))\
40+
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif -%}
41+
{% if commit.github.pr_number %} in \
42+
[#{{ commit.github.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.github.pr_number }}) \
43+
{%- endif -%}
3644
{% endfor %}
3745
{% endfor %}\n
46+
47+
{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
48+
## New Contributors
49+
{%- endif -%}
50+
51+
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
52+
* @{{ contributor.username }} made their first contribution
53+
{%- if contributor.pr_number %} in \
54+
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
55+
{%- endif %}
56+
{%- endfor %}\n
3857
"""
3958
# template for the changelog footer
4059
footer = """
@@ -82,7 +101,7 @@ commit_parsers = [
82101
# protect breaking changes from being skipped due to matching a skipping commit_parser
83102
protect_breaking_commits = false
84103
# filter out the commits that are not matched by commit parsers
85-
filter_commits = true
104+
filter_commits = false
86105
# regex for matching git tags
87106
# tag_pattern = "v[0-9].*"
88107
# regex for skipping tags
@@ -95,3 +114,7 @@ topo_order = false
95114
sort_commits = "oldest"
96115
# limit the number of commits included in the changelog.
97116
# limit_commits = 42
117+
118+
[remote.github]
119+
owner = "BITNP"
120+
repo = "BIThesis"

0 commit comments

Comments
 (0)