Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit f8871c1

Browse files
committed
docs(changelog): Add git-cliff configuration
Conventional Commit scopes don't seem entirely compatible with Keep a Changelog's sections/headers, so I have abandoned the Keep a Changelog sections/headers for custom ones that more accurately represent the commit's scope.
1 parent f7f9745 commit f8871c1

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

cliff.toml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# git-cliff ~ default configuration file
2+
# https://git-cliff.org/docs/configuration
3+
4+
[changelog]
5+
header = """
6+
# Changelog\n
7+
All notable changes to this project will be documented in this file.
8+
9+
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
10+
11+
Versions [3.0.0] and older use a format based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12+
but versions thereafter use a custom changelog format using [git-cliff](https://git-cliff.org).\n
13+
"""
14+
body = """
15+
{% if version -%}
16+
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
17+
{% else -%}
18+
## [Unreleased]
19+
{% endif -%}
20+
{% for group, commits in commits | group_by(attribute="group") %}
21+
### {{ group | striptags | trim | upper_first }}
22+
{% for commit in commits %}
23+
- {% if commit.scope %}*{{ commit.scope }}*: {% endif %}\
24+
{% if commit.breaking %}[**breaking**] {% endif %}\
25+
{{ commit.message | upper_first }}\
26+
{% endfor %}
27+
{% endfor %}\n
28+
"""
29+
footer = """
30+
{% for release in releases -%}
31+
{% if release.version -%}
32+
{% if release.previous.version -%}
33+
[{{ release.version | trim_start_matches(pat="v") }}]: \
34+
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
35+
/compare/{{ release.previous.version }}..{{ release.version }}
36+
{% endif -%}
37+
{% else -%}
38+
[unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
39+
/compare/{{ release.previous.version }}..HEAD
40+
{% endif -%}
41+
{% endfor %}
42+
"""
43+
trim = true
44+
postprocessors = [
45+
# { pattern = '<REPO>', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL
46+
]
47+
48+
[git]
49+
conventional_commits = true
50+
filter_unconventional = true
51+
split_commits = false
52+
commit_preprocessors = []
53+
commit_parsers = [
54+
{ message = "^feat", group = "<!-- 0 -->Features" },
55+
{ message = "^fix|revert", group = "<!-- 1 -->Bug Fixes" },
56+
{ message = "^docs", group = "<!-- 2 -->Documentation" },
57+
{ message = "^style", skip = true },
58+
{ message = "^refactor", group = "<!-- 3 -->Changes" },
59+
{ message = "^perf", group = "<!-- 4 -->Performance Improvements" },
60+
{ message = "^test", skip = true },
61+
{ message = "^build", group = "<!-- 5 -->Builds" },
62+
{ message = "^ci", skip = true },
63+
{ message = "^chore", skip = true },
64+
]
65+
protect_breaking_commits = false
66+
filter_commits = false
67+
# tag_pattern = "v[0-9].*"
68+
# skip_tags = ""
69+
# ignore_tags = ""
70+
topo_order = false
71+
sort_commits = "oldest"

0 commit comments

Comments
 (0)