-
Notifications
You must be signed in to change notification settings - Fork 55
/
cliff.toml
138 lines (116 loc) · 4.89 KB
/
cliff.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Config: https://git-cliff.org/docs/configuration
[changelog]
header = """
## What's Changed\n
All notable changes to this project will be documented in this file.\n
"""
# template for the changelog body
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
{%- endmacro -%}
{%- macro pr_link(num) -%}
{%- if num -%}
{% raw %} {% endraw %}- [#{{ num }}]({{ self::remote_url() }}/pull/{{ num }})\
{% endif -%}
{%- endmacro -%}
{% for group, commits in commits | group_by(attribute="group") %}
{% for commit in commits | filter(attribute="merge_commit", value=true)
%}
{%- if loop.first -%}
### {{ group | striptags | trim | upper_first }}
{% raw %}\n{% endraw %}\
{% endif -%}
{%- if commit.github.pr_labels is containing("skip-release-notes") -%}
{%- continue -%}
{%- endif -%}
{%- if commit.github.pr_title -%}
{%- set commit_message = commit.github.pr_title | split(pat=":") | last | trim -%}
{%- else -%}
{%- set commit_message = commit.message -%}
{%- endif -%}
{%- set_global themes = [] -%}
{%- for label in commit.github.pr_labels -%}
{%- set_global theme = label | trim_start_matches(pat='theme:') -%}
{%- if label is starting_with("theme:") -%}
{%- set_global themes = themes | concat(with=theme) -%}
{%- endif -%}\
{%- endfor -%}
{% if commit.scope -%}
{%- set default_scope = commit.scope | trim -%}
{%- elif commit.github.pr_title and commit.github.pr_title is containing(":") -%}
{%- set default_scope = commit.github.pr_title | split(pat=":") | first | trim -%}
{%- else -%}
{%- set default_scope = "general" -%}
{%- endif -%}
{%- if themes -%}
- *{{ themes | join(sep="|") | replace(from="theme:", to="") }}*: {{ commit_message }}{{ self::pr_link(num=commit.github.pr_number) }}
{% elif commit.scope -%}
- *{{ commit.scope }}*: {{ commit_message }}{{ self::pr_link(num=commit.github.pr_number) }}
{% else -%}
- *{{ default_scope }}*: {{ commit_message }}{{ self::pr_link(num=commit.github.pr_number) }}
{% endif -%}
{%- endfor -%}
{% endfor %}
"""
# template for the changelog footer
# Notes:
# * The `release.previous.version` value will not be correct when it is not run on a tag
#
footer = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% for release in releases -%}
{% if release.version -%}
{% if loop.first -%}
{% if release.previous.version -%}
{% raw %}\n\n{% endraw %}\
**Full Changelog**: \
{{ self::remote_url() }}/compare/{{release.previous.version}}..{{ release.version }}
{% endif -%}
{% endif -%}
{% else -%}
[unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
{% endif -%}
{% endfor %}
<!-- generated by git-cliff -->
"""
# remove the leading and trailing whitespace from the templates
trim = true
[git]
conventional_commits = false
filter_unconventional = false
split_commits = false
commit_parsers = [
{ message = "disable memory logging by default to avoid log spammi", skip = true },
# skip commits matching:
{ message = "version bump", skip = true },
{ message = "prepare for release", skip = true },
{ message = "Merge branch 'main' into", skip = true },
{ message = "Merge remote-tracking branch 'origin/main' into", skip = true },
# classify commits into sections
{ message = "feat(\\(.+\\))?:", group = "<!-- 0 -->:rocket: Features" },
{ message = "(doc|docs)(\\(.+\\))?:", group = "<!-- 2 -->:notebook: Documentation" },
{ message = "fix(\\(.+\\))?:", group = "<!-- 1 -->:bug: Bug Fixes" },
{ message = "perf(\\(.+\\))?:", group = "<!-- 3 -->:runner: Performance" },
{ message = "(refactor|refactoring)(\\(.+\\))?:", group = "<!-- 4 -->:sailboat: Refactor" },
{ message = "style(\\(.+\\))?:", group = "<!-- 5 -->:nail_care: Styling" },
{ message = "(test|tests|testing)(\\(.+\\))?:", group = "<!-- 6 -->:mag_right: Testing" },
{ message = "ci(\\(.+\\))?:", group = "<!-- 9 -->:mag_right: CI/CD" },
{ message = "chore(\\(.+\\))?:", group = "<!-- 7 -->:clipboard: Miscellaneous Tasks" },
{ body = ".*security", group = "<!-- 8 -->:lock: Security" },
{ message = ".*", group = "<!-- 7 -->:clipboard: Miscellaneous Tasks"},
]
protect_breaking_commits = false
filter_commits = false
ignore_tags = "^([a-zA-Z]+|.*-rc)"
tag_pattern = "[0-9].*"
topo_order = true
sort_commits = "oldest"
link_parsers = [
{ pattern = "#(\\d+)", href = "https://github.com/thin-edge/thin-edge.io/issues/$1"},
]
[remote.github]
owner = "thin-edge"
repo = "thin-edge.io"