-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathcliff.toml
More file actions
257 lines (216 loc) · 9.66 KB
/
cliff.toml
File metadata and controls
257 lines (216 loc) · 9.66 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# https://git-cliff.org/docs/configuration
#
# For manual CHANGELOG management tasks:
# - Force release with manual version: edit release PR title.
# - Remove specific commit: add hash to `.cliffignore` file.
# - Fix specific commit: use `postprocessors=` with commit hash.
# - Fix typo in all commits: use `commit_preprocessors=`.
# - Add text for specific released version: use `body=`.
[bump]
# Feature bump minor for 0.x.y version.
features_always_bump_minor = true
# Breaking bump minor for 0.x.y or major otherwise.
breaking_always_bump_major = false
# When set, the version will be set to this value if no tags are found.
initial_tag = 'v0.1.0'
# Configures additional commit types that should increment the major or minor accordingly.
# custom_major_increment_regex = 'bump-major'
# custom_minor_increment_regex = 'bump-minor'
# When set, it forces to always bump in major, minor or patch.
# bump_type = 'minor'
[changelog]
# https://keats.github.io/tera/docs/#introduction
header = """
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
"""
body = """
{%- macro remote_diff_url(from, to) -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/compare/{{ from }}..{{ to }}
{%- endmacro -%}
{%- macro remote_pr_url(id) -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/pull/{{ id }}
{%- endmacro -%}
{%- macro remote_commit_url(id) -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}/commit/{{ id }}
{%- endmacro -%}
{%- macro commit(commit) -%}
{% if commit.scope %}**({{ commit.scope }})** {% endif %}\
{% if commit.breaking %}**⚠️ BREAKING!** {% endif %}\
{{ commit.message | split(pat="\n") | first | upper_first | trim }} by \
{% if commit.remote.username %}@{{ commit.remote.username }}
{%- else %}{{ commit.author.name }}
{%- endif %} in \
{% if commit.remote.pr_number -%}
[#{{ commit.remote.pr_number }}]
{%- else -%}
[{{ commit.id | truncate(length=7, end="") }}]
{%- endif %}
{%- endmacro -%}
{%- if version %}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}
## [Unreleased]
{% endif -%}
{#- Example: Add custom content to specific version -#}
{#-
{%- if version and version is matching("v1.2.3") %}
### 🐛 Fixed (post-release)
- Critical issue discovered after release
{% endif -%}
-#}
{%- for group, commits in commits | group_by(attribute="group") %}
{%- if group is not matching("Chore|Testing") %}
### {{ group | striptags | trim }}
{% for commit in commits | filter(attribute="scope") | sort(attribute="scope") -%}
- {{ self::commit(commit=commit) }}
{% endfor -%}
{% for commit in commits -%}
{%- if not commit.scope -%}
- {{ self::commit(commit=commit) }}
{% endif -%}
{% endfor -%}
{%- endif -%}
{%- endfor -%}
{#- TEMPORARY DISABLED because of unreliable is_first_time flag:
https://github.com/orhun/git-cliff/issues/1096#issuecomment-2972964855
{%- set contributors = github.contributors | filter(attribute="is_first_time", value=true) -%}
{%- if contributors | length != 0 %}
### New Contributors
{% for contributor in contributors -%}
- @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number and contributor.pr_title is not starting_with("chore: release") %} in \
[#{{ contributor.pr_number }}]({{ self::remote_pr_url(id=contributor.pr_number) }})
{%- endif %}
{% endfor -%}
{%- endif -%}
-#}
{% if version %}
[{{ version | trim_start_matches(pat="v") }}]: \
{% if previous.version -%}
{{ self::remote_diff_url(from=previous.version, to=version) }}
{%- else -%}
{{ self::remote_diff_url(from="%40%7B10year%7D", to=version) }}
{%- endif %}
{% else %}
[Unreleased]: \
{% if previous.version -%}
{{ self::remote_diff_url(from=previous.version, to="HEAD") }}
{%- else -%}
{{ self::remote_diff_url(from="%40%7B10year%7D", to="HEAD") }}
{%- endif %}
{% endif -%}
{% for commit in commits -%}
{%- if commit.group is not matching("Chore|Testing") -%}
{% if commit.remote.pr_number -%}
[#{{ commit.remote.pr_number }}]: {{ self::remote_pr_url(id=commit.remote.pr_number) }}
{%- else -%}
[{{ commit.id | truncate(length=7, end="") }}]: {{ self::remote_commit_url(id=commit.id) }}
{%- endif %}
{% endif -%}
{% endfor -%}
"""
footer = """
<!-- generated by git-cliff -->
"""
# Remove the leading and trailing whitespace from the templates.
trim = true
# Render body even when there are no releases to process.
# render_always = true
# Manual fixes before output.
# https://git-cliff.org/docs/configuration/git#commit_preprocessors
#
# Fix release date.
# [[changelog.postprocessors]]
# pattern = '\n## \[1.2.3\] - 2025-05-02'
# replace = "\n## [1.2.3] - 2025-05-01"
#
# Fix a specific commit description by hash
# [[changelog.postprocessors]]
# pattern = '- Wrong description (by @author in \[abc1234\])'
# replace = '- Correct description $1'
[git]
# Parse the commits based on https://www.conventionalcommits.org.
conventional_commits = true
# Do not filter out the commits that are not conventional.
filter_unconventional = false
# Do not fail changelog generation on unconventional commits.
require_conventional = false
# Do not process each line of a commit as an individual commit.
split_commits = false
# An array of commit preprocessors for manipulating the commit messages before
# parsing/grouping them.
# https://git-cliff.org/docs/configuration/git#commit_preprocessors
commit_preprocessors = [
# Fix global typos in commit messages.
# { pattern = 'teh ', replace = 'the ' },
# { pattern = 'recieve', replace = 'receive' },
{ pattern = 'compatiblity', replace = 'compatibility' },
{ pattern = ' windows', replace = ' Windows' },
# Fix spelling in commits with https://github.com/crate-ci/typos.
# { pattern = '.*', replace_command = 'typos --write-changes -' },
# Replace multiple spaces with a single space.
{ pattern = ' +', replace = ' ' },
# Remove issue numbers from commits.
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = '' },
# Escape <key> to ensure it won't be processed as <tag>.
{ pattern = '(<[^>]+>)$', replace = '`${1}`' },
]
# An array of commit parsers for determining the commit groups by using regex. The entire
# commit messages are affected wherever the regex is matched.
# https://git-cliff.org/docs/configuration/git#commit_parsers
commit_parsers = [
{ message = '^chore: release', skip = true },
{ message = '^Merge ', skip = true },
{ message = '^(feat|fix)\((test|ci|build)\)', group = '<!-- X -->⚙️ Chore' },
{ message = '^(fix|chore)\(deps\)', group = '<!-- 8 -->📦️ Dependencies' },
# { message = '^[^:]*!:', group = '<!-- 0 -->⚠️ Breaking Change!' },
{ message = '^fix\(security\)', group = '<!-- 0 -->🛡️ Security' },
{ message = '^fix.* [Vv]ulnerabilit', group = '<!-- 0 -->🛡️ Security' },
{ message = '^fix.* [Ss]ecur', group = '<!-- 0 -->🛡️ Security' },
{ message = '^fix.* CVE', group = '<!-- 0 -->🛡️ Security' },
{ message = '^feat.*: [Rr]emove', group = '<!-- 1 -->➖ Removed' },
{ message = '^feat.*: [Dd]elete', group = '<!-- 1 -->➖ Removed' },
{ message = '^feat.*: [Dd]rop', group = '<!-- 1 -->➖ Removed' },
{ message = '^(Revert|Reapply) "(feat|fix)', group = '<!-- 1 -->◀️ Revert' },
{ message = '^feat.* [Dd]eprecat', group = '<!-- 2 -->❌ Deprecated' },
{ message = '^feat.*: [Aa]dd', group = '<!-- 3 -->🚀 Added' },
{ message = '^feat.*: [Ii]mplement', group = '<!-- 3 -->🚀 Added' },
{ message = '^feat.*: [Ss]upport', group = '<!-- 3 -->🚀 Added' },
{ message = '^feat', group = '<!-- 4 -->🔔 Changed' },
{ message = '^fix', group = '<!-- 5 -->🐛 Fixed' },
{ message = '^perf', group = '<!-- 6 -->⚡ Performance' },
{ message = '^docs', group = '<!-- 7 -->📚 Documentation' },
{ message = '^build', group = '<!-- X -->⚙️ Chore' },
{ message = '^chore', group = '<!-- X -->⚙️ Chore' },
{ message = '^ci', group = '<!-- X -->⚙️ Chore' },
{ message = '^refactor', group = '<!-- X -->⚙️ Chore' },
{ message = '^test', group = '<!-- Z -->🧪 Testing' },
{ message = '.', group = '<!-- 4 -->🔔 Changed' },
]
# Any breaking changes is protected against being skipped due to any commit parser.
protect_breaking_commits = true
# Do not filter out the commits that are not matched by commit parsers.
filter_commits = false
# A regular expression for matching the git tags.
# tag_pattern = '^v[0-9]'
# Skip processing (drop commits from the changelog) the matched tags.
skip_tags = 'v0.1.0'
# Ignore processing the matched tags (but include ignored commits into the next tag).
ignore_tags = '-'
# Counting in (an inverted version of ignore_tags) the matched tags in the final result.
# count_tags = '-beta'
# Process tags in chronological order instead of topological order.
topo_order = false
# Sort the commits inside sections by oldest/newest order.
sort_commits = 'oldest'
# Link parsers for extracting external references, and turning them into URLs, using regex.
# These extracted links can be used in the template with commits.links variable.
link_parsers = [
# { pattern = "#(\\d+)", href = "https://github.com/USER/REPO/issues/$1"},
# { pattern = "RFC(\\d+)", text = "ietf-rfc$1", href = "https://datatracker.ietf.org/doc/html/rfc$1"},
]
# Limits the number of included commits in the generated changelog.
# limit_commits = 42