Skip to content

Commit efd7b5d

Browse files
committed
chore: add cliff template
1 parent 56bd106 commit efd7b5d

File tree

1 file changed

+106
-0
lines changed

1 file changed

+106
-0
lines changed

cliff.toml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# git-cliff ~ configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
# A Tera template to be rendered as the changelog's footer.
6+
# See https://keats.github.io/tera/docs/#introduction
7+
# header = """
8+
# # Changelog\n
9+
# All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.\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+
{% for group, commits in commits | group_by(attribute="group") %}
15+
### {{ group | striptags | trim | upper_first }}
16+
{% for commit in commits
17+
| filter(attribute="scope")
18+
| sort(attribute="scope") %}
19+
- **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \
20+
{{ commit.message }} by [@{{ commit.author.name }}](https://github.com/{{ commit.author.name }}) in [{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})
21+
{%- endfor -%}
22+
{% raw %}\n{% endraw %}\
23+
{%- for commit in commits %}
24+
{%- if commit.scope -%}
25+
{% else -%}
26+
- {% if commit.breaking %} [**breaking**]{% endif %}\
27+
{{ commit.message }} by [@{{ commit.author.name }}](https://github.com/{{ commit.author.name }}) in [{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})
28+
{% endif -%}
29+
{% endfor -%}
30+
{% endfor %}
31+
32+
33+
{% if github.contributors | length > 0 %}
34+
### 🎉 Contributors
35+
36+
{% for contributor in github.contributors %}
37+
- [@{{ contributor.username }}](https://github.com/{{ contributor.username }})
38+
{%- endfor -%}
39+
{% endif %}
40+
41+
42+
{% if version %}
43+
{% if previous.version %}\
44+
**Full Changelog**: [{{ version | trim_start_matches(pat="v") }}]($REPO/compare/{{ previous.version }}..{{ version }})
45+
{% else %}\
46+
**Full Changelog**: [{{ version | trim_start_matches(pat="v") }}]
47+
{% endif %}\
48+
{% else %}\
49+
## [unreleased]
50+
{% endif %}
51+
"""
52+
# A Tera template to be rendered as the changelog's footer.
53+
# See https://keats.github.io/tera/docs/#introduction
54+
55+
footer = """
56+
57+
"""
58+
59+
# Remove leading and trailing whitespaces from the changelog's body.
60+
trim = true
61+
# postprocessors
62+
postprocessors = [
63+
# Replace the placeholder `<REPO>` with a URL.
64+
{ pattern = '\$REPO', replace = "https://github.com/RapidAI/RapidLayout" }, # replace repository URL
65+
]
66+
67+
[git]
68+
# Parse commits according to the conventional commits specification.
69+
# See https://www.conventionalcommits.org
70+
conventional_commits = true
71+
# Exclude commits that do not match the conventional commits specification.
72+
filter_unconventional = true
73+
# Split commits on newlines, treating each line as an individual commit.
74+
split_commits = false
75+
# An array of regex based parsers to modify commit messages prior to further processing.
76+
commit_preprocessors = [
77+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
78+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"},
79+
]
80+
# An array of regex based parsers for extracting data from the commit message.
81+
# Assigns commits to groups.
82+
# Optionally sets the commit's scope and can decide to exclude commits from further processing.
83+
commit_parsers = [
84+
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
85+
{ message = "^fix", group = "<!-- 1 -->🐛 Bug Fixes" },
86+
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
87+
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
88+
{ message = "^refactor", group = "<!-- 2 -->🚜 Refactor" },
89+
{ message = "^style", group = "<!-- 5 -->🎨 Styling" },
90+
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
91+
{ message = "^chore\\(release\\): prepare for", skip = true },
92+
{ message = "^chore\\(deps.*\\)", skip = true },
93+
{ message = "^chore\\(pr\\)", skip = true },
94+
{ message = "^chore\\(pull\\)", skip = true },
95+
{ message = "^chore|^ci", group = "<!-- 7 -->⚙️ Miscellaneous Tasks" },
96+
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
97+
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
98+
{ message = ".*", group = "<!-- 10 -->💼 Other" },
99+
]
100+
# Exclude commits that are not matched by any commit parser.
101+
filter_commits = false
102+
# Order releases topologically instead of chronologically.
103+
topo_order = false
104+
# Order of commits in each group/release within the changelog.
105+
# Allowed values: newest, oldest
106+
sort_commits = "newest"

0 commit comments

Comments
 (0)