Skip to content

Commit a4a8d9a

Browse files
committed
chore: Add git-cliff configuration file for changelog generation
1 parent 77d7849 commit a4a8d9a

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

cliff.toml

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

0 commit comments

Comments
 (0)