Skip to content

Commit 1e166d8

Browse files
committed
chore: add git-cliff config
1 parent 85c01f4 commit 1e166d8

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

cliff.toml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
5+
[changelog]
6+
# A Tera template to be rendered as the changelog's footer.
7+
# See https://keats.github.io/tera/docs/#introduction
8+
header = """
9+
# Changelog\n
10+
"""
11+
# A Tera template to be rendered for each release in the changelog.
12+
# See https://keats.github.io/tera/docs/#introduction
13+
body = """
14+
{% if version %}\
15+
## [{{ version | trim_start_matches(pat="v") }}]
16+
{% else %}\
17+
## [unreleased]
18+
{% endif %}\
19+
{% for group, commits in commits | group_by(attribute="group") %}
20+
### {{ group | striptags | trim | upper_first }}
21+
{% for commit in commits %}
22+
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
23+
{% if commit.breaking %}[**breaking**] {% endif %}\
24+
{{ commit.message | upper_first }}\
25+
{% endfor %}
26+
{% endfor %}\n
27+
"""
28+
# A Tera template to be rendered as the changelog's footer.
29+
# See https://keats.github.io/tera/docs/#introduction
30+
footer = """
31+
<!-- generated by git-cliff -->
32+
"""
33+
# Remove leading and trailing whitespaces from the changelog's body.
34+
trim = true
35+
# Render body even when there are no releases to process.
36+
render_always = true
37+
# An array of regex based postprocessors to modify the changelog.
38+
postprocessors = [
39+
# Replace the placeholder <REPO> with a URL.
40+
#{ pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" },
41+
]
42+
# render body even when there are no releases to process
43+
# render_always = true
44+
# output file path
45+
# output = "test.md"
46+
47+
[git]
48+
# Parse commits according to the conventional commits specification.
49+
# See https://www.conventionalcommits.org
50+
conventional_commits = true
51+
# Exclude commits that do not match the conventional commits specification.
52+
filter_unconventional = false
53+
# Require all commits to be conventional.
54+
# Takes precedence over filter_unconventional.
55+
require_conventional = false
56+
# Split commits on newlines, treating each line as an individual commit.
57+
split_commits = false
58+
# An array of regex based parsers to modify commit messages prior to further processing.
59+
commit_preprocessors = [
60+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
61+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))"},
62+
# Check spelling of the commit message using https://github.com/crate-ci/typos.
63+
# If the spelling is incorrect, it will be fixed automatically.
64+
#{ pattern = '.*', replace_command = 'typos --write-changes -' },
65+
]
66+
# Prevent commits that are breaking from being excluded by commit parsers.
67+
protect_breaking_commits = false
68+
# An array of regex based parsers for extracting data from the commit message.
69+
# Assigns commits to groups.
70+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
71+
commit_parsers = [
72+
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
73+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
74+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
75+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
76+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
77+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
78+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
79+
{ message = "^chore\\(release\\): prepare for", skip = true },
80+
{ message = "^chore\\(deps.*\\)", skip = true },
81+
{ message = "^chore\\(pr\\)", skip = true },
82+
{ message = "^chore\\(pull\\)", skip = true },
83+
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
84+
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
85+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
86+
{ message = ".*", group = "<!-- 10 -->💼 Other" },
87+
]
88+
# Exclude commits that are not matched by any commit parser.
89+
filter_commits = false
90+
# An array of link parsers for extracting external references, and turning them into URLs, using regex.
91+
link_parsers = []
92+
# Include only the tags that belong to the current branch.
93+
use_branch_tags = false
94+
# Order releases topologically instead of chronologically.
95+
topo_order = false
96+
# Order releases topologically instead of chronologically.
97+
topo_order_commits = true
98+
# Order of commits in each group/release within the changelog.
99+
# Allowed values: newest, oldest
100+
sort_commits = "oldest"
101+
# Process submodules commits
102+
recurse_submodules = false

0 commit comments

Comments
 (0)