Skip to content

Commit 74c2b0d

Browse files
committed
chore: add git-cliff config
1 parent 808b6d4 commit 74c2b0d

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

β€Žcliff.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# template for the changelog header
6+
header = """
7+
# Changelog\n
8+
All notable changes to this project will be documented in this file.\n
9+
"""
10+
# template for the changelog body
11+
# https://keats.github.io/tera/docs/#introduction
12+
body = """
13+
{% if version %}\
14+
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
15+
{% else %}\
16+
## Unreleased
17+
{% endif %}\
18+
{% if previous %}\
19+
{% if previous.commit_id and commit_id %}
20+
[{{ previous.commit_id | truncate(length=7, end="") }}]({{ previous.commit_id }})...\
21+
[{{ commit_id | truncate(length=7, end="") }}]({{ commit_id }})
22+
{% endif %}\
23+
{% endif %}\
24+
{% for group, commits in commits | group_by(attribute="group") %}
25+
### {{ group | upper_first }}
26+
{% for commit in commits %}
27+
- {{ commit.message | split(pat="\n") | first | upper_first | trim }} ([{{ commit.id | truncate(length=7, end="") }}]({{ commit.id }}))\
28+
{% for footer in commit.footers -%}
29+
, {{ footer.token }}{{ footer.separator }}{{ footer.value }}\
30+
{% endfor %}\
31+
{% endfor %}
32+
{% endfor %}\n
33+
"""
34+
# template for the changelog footer
35+
footer = """
36+
<!-- generated by git-cliff -->
37+
"""
38+
# remove the leading and trailing whitespace from the templates
39+
trim = true
40+
41+
[git]
42+
# parse the commits based on https://www.conventionalcommits.org
43+
conventional_commits = true
44+
# filter out the commits that are not conventional
45+
filter_unconventional = false
46+
# regex for parsing and grouping commits
47+
commit_parsers = [
48+
{ message = "^feat", group = "<!-- 0 -->πŸš€ Features" },
49+
{ message = "^fix", group = "<!-- 1 -->πŸ› Bug Fixes" },
50+
{ message = "^doc", group = "<!-- 3 -->πŸ“š Documentation" },
51+
{ message = "^perf", group = "<!-- 4 -->⚑ Performance" },
52+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
53+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
54+
{ message = "^test", group = "<!-- 6 -->πŸ§ͺ Testing" },
55+
{ message = "^chore\\(release\\): prepare for", skip = true },
56+
{ message = "^chore\\(deps.*\\)", skip = true },
57+
{ message = "^chore\\(pr\\)", skip = true },
58+
{ message = "^chore\\(pull\\)", skip = true },
59+
{ message = "^chore|^ci", group = "<!-- 7 -->βš™οΈ Miscellaneous Tasks" },
60+
{ body = ".*security", group = "<!-- 8 -->πŸ›‘οΈ Security" },
61+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
62+
{ message = ".*", group = "<!-- 10 -->πŸ’Ό Other" },
63+
]
64+
# filter out the commits that are not matched by commit parsers
65+
filter_commits = false
66+
# sort the tags topologically
67+
topo_order = false
68+
# sort the commits inside sections by oldest/newest order
69+
sort_commits = "oldest"

0 commit comments

Comments
Β (0)