Skip to content

Commit 6596297

Browse files
authored
chore: add cliff.toml (config file for git-cliff) (#257)
1 parent 8d93326 commit 6596297

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

cliff.toml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# configuration file for git-cliff (0.1.0)
2+
3+
[changelog]
4+
# changelog header
5+
header = """
6+
# Changelog\n
7+
All notable changes to this project will be documented in this file.\n
8+
"""
9+
# template for the changelog body
10+
# https://tera.netlify.app/docs/#introduction
11+
body = """
12+
{% if version %}\
13+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
14+
{% else %}\
15+
## [unreleased]
16+
{% endif %}\
17+
{% for group, commits in commits | group_by(attribute="group") %}
18+
### {{ group | upper_first }}
19+
{% for commit in commits %}
20+
- {% if commit.breaking %}[**breaking**] {% endif %}{{ commit.message | upper_first }}\
21+
{% endfor %}
22+
{% endfor %}\n
23+
"""
24+
# remove the leading and trailing whitespace from the template
25+
trim = true
26+
# changelog footer
27+
footer = """
28+
<!-- generated by git-cliff -->
29+
"""
30+
31+
[git]
32+
# parse the commits based on https://www.conventionalcommits.org
33+
conventional_commits = true
34+
# filter out the commits that are not conventional
35+
filter_unconventional = true
36+
# regex for preprocessing the commit messages
37+
commit_preprocessors = [
38+
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/tskit-dev/tskit-rust/pull/${2}))"},
39+
]
40+
# regex for parsing and grouping commits
41+
commit_parsers = [
42+
{ message = "^feat", group = "Features"},
43+
{ message = "^fix", group = "Bug Fixes"},
44+
{ message = "^doc", group = "Documentation"},
45+
{ message = "^perf", group = "Performance"},
46+
{ message = "^refactor", group = "Refactor"},
47+
{ message = "^style", group = "Styling"},
48+
{ message = "^test", group = "Testing"},
49+
{ message = "^chore\\(release\\): prepare for", skip = true},
50+
{ message = "^chore", group = "Miscellaneous Tasks"},
51+
{ body = ".*security", group = "Security"},
52+
]
53+
# filter out the commits that are not matched by commit parsers
54+
filter_commits = true
55+
# glob pattern for matching git tags
56+
tag_pattern = "v?[0-9]*"
57+
# regex for skipping tags
58+
skip_tags = "v0.1.0-beta.1"
59+
# regex for ignoring tags
60+
ignore_tags = ""
61+
# sort the tags chronologically
62+
date_order = false
63+
# sort the commits inside sections by oldest/newest order
64+
sort_commits = "oldest"

0 commit comments

Comments
 (0)