-
Notifications
You must be signed in to change notification settings - Fork 0
/
cliff.toml
80 lines (72 loc) · 3.2 KB
/
cliff.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# yaml-language-server: $schema=https://raw.githubusercontent.com/MarcoIeni/release-plz/refs/heads/main/.schema/latest.json
[changelog]
render_always = true
use_branch_tags = true
header = """
# Changelog\n
All notable changes to this project will be documented in this file.
"""
body = """
{%- set mapCommitsByDate = commits | unique(attribute="message") | filter(attribute="merge_commit", value=false) | group_by(attribute="extra.date") -%}
{%- set_global listCommitsOrderedByDate = [] -%}
{%- for commit, ignored in mapCommitsByDate -%}
{%- set_global listCommitsOrderedByDate = listCommitsOrderedByDate | concat(with=commit) -%}
{% endfor %}
{% for commits in listCommitsOrderedByDate | reverse %}
## {{ commits }}
{% for group, commits in mapCommitsByDate[commits] | group_by(attribute="group") %}
### {{ group | striptags | trim }}
{% for commit in commits %}
- {% if commit.scope %}*({{ commit.scope }})* {% endif %}\
{% if commit.breaking %}[**breaking**] {% endif %}\
\\[[{{ commit.id | truncate(length=8, end="") }}](<COMMIT_URL>/{{ commit.id }})\\] {{ commit.message | split(pat="\n") | first | trim }}\
{% endfor %}
{% endfor %}
{% endfor %}
"""
footer = """
<!-- generated by git-cliff -->
"""
# remove the leading and trailing s
trim = true
# postprocessors
postprocessors = [
{ pattern = '<REPO_URL>', replace = "https://github.com/silveiralexf/.dotfiles" },
{ pattern = '<COMMIT_URL>', replace = "https://github.com/silveiralexf/.dotfiles/commit" },
{ pattern = "@gmail.com", replace = "" },
]
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
{ pattern = " +", replace = " " }, # remove multiple whitespaces
{ pattern = "https://github.com/.*/issues/([0-9]+)", replace = "[Issue #${1}]" }, # turn issue links into numbers
{ pattern = "Former-commit-id:.*", replace = "" },
{ pattern = "\n\n$", replace = "" },
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^hack", skip = true },
{ message = ".*deps.*", group = "<!-- 10 -->📦 Dependencies" },
{ message = "^feat", group = "<!-- 0 -->🚀 Features" },
{ message = "^fix", group = "<!-- 7 -->🔨 Fixes" },
{ message = "^refactor", group = "<!-- 2 --> 🏭 Refactor" },
{ message = "^doc", group = "<!-- 3 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 4 -->⚡ Performance" },
{ message = "^style|^lint", group = "<!-- 5 -->🎨 Styling" },
{ message = "^test", group = "<!-- 6 -->🧪 Testing" },
{ body = ".*security", group = "<!-- 8 -->🛡️ Security" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = "^chore|^ci|\\(ci\\)", group = "<!-- 8 -->⚙️ Chores" },
]
# filter out the commits that are not matched by commit parsers
filter_commits = true
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "newest"