Skip to content

Commit d6f9354

Browse files
committed
chore: add git cliff
1 parent ac3977f commit d6f9354

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+
[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+
---
15+
{% if version %}\
16+
{% if previous.version %}\
17+
## [{{ version | trim_start_matches(pat="v") }}]($REPO/compare/{{ previous.version }}..{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
18+
{% else %}\
19+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
20+
{% endif %}\
21+
{% else %}\
22+
## [unreleased]
23+
{% endif %}\
24+
{% for group, commits in commits | group_by(attribute="group") %}
25+
### {{ group | striptags | trim | upper_first }}
26+
{% for commit in commits
27+
| filter(attribute="scope")
28+
| sort(attribute="scope") %}
29+
- **({{commit.scope}})**{% if commit.breaking %} [**breaking**]{% endif %} \
30+
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }}
31+
{%- endfor -%}
32+
{% raw %}\n{% endraw %}\
33+
{%- for commit in commits %}
34+
{%- if commit.scope -%}
35+
{% else -%}
36+
- {% if commit.breaking %} [**breaking**]{% endif %}\
37+
{{ commit.message }} - ([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }}
38+
{% endif -%}
39+
{% endfor -%}
40+
{% endfor %}\n
41+
"""
42+
# A Tera template to be rendered as the changelog's footer.
43+
# See https://keats.github.io/tera/docs/#introduction
44+
footer = """
45+
<!-- generated by git-cliff -->
46+
"""
47+
# Remove leading and trailing whitespaces from the changelog's body.
48+
trim = true
49+
# postprocessors
50+
postprocessors = [
51+
# Replace the placeholder `<REPO>` with a URL.
52+
{ pattern = '\$REPO', replace = "https://github.com/cocogitto/cocogitto" }, # replace repository URL
53+
]
54+
55+
[git]
56+
# Parse commits according to the conventional commits specification.
57+
# See https://www.conventionalcommits.org
58+
conventional_commits = true
59+
# Exclude commits that do not match the conventional commits specification.
60+
filter_unconventional = true
61+
# Split commits on newlines, treating each line as an individual commit.
62+
split_commits = false
63+
# An array of regex based parsers to modify commit messages prior to further processing.
64+
commit_preprocessors = [
65+
# Replace issue numbers with link templates to be updated in `changelog.postprocessors`.
66+
#{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/orhun/git-cliff/issues/${2}))"},
67+
]
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 = "Features" },
73+
{ message = "^fix", group = "Bug Fixes" },
74+
{ message = "^doc", group = "Documentation" },
75+
{ message = "^perf", group = "Performance" },
76+
{ message = "^refactor", group = "Refactoring" },
77+
{ message = "^style", group = "Style" },
78+
{ message = "^revert", group = "Revert" },
79+
{ message = "^test", group = "Tests" },
80+
{ message = "^chore\\(version\\):", skip = true },
81+
{ message = "^chore", group = "Miscellaneous Chores" },
82+
{ body = ".*security", group = "Security" },
83+
]
84+
# Exclude commits that are not matched by any commit parser.
85+
filter_commits = false
86+
# Order releases topologically instead of chronologically.
87+
topo_order = false
88+
# Order of commits in each group/release within the changelog.
89+
# Allowed values: newest, oldest
90+
sort_commits = "oldest"

0 commit comments

Comments
 (0)