forked from tokio-rs/console
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cliff.toml
114 lines (111 loc) · 4.71 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# git-cliff ~ default configuration file
# https://git-cliff.org/docs/configuration
#
# Lines starting with "#" are comments.
# Configuration options are organized into tables and keys.
# See documentation for more information on available options.
[changelog]
# changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
"""
# template for the changelog body
# https://tera.netlify.app/docs/#introduction
body = """
{% if version %}\
## {{ version | trim_start_matches(pat="v") }} - ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
## Unreleased
{% endif %}\
{% if previous %}\
{% if previous.commit_id %}
[{{ previous.commit_id | truncate(length=7, end="") }}](https://github.com/tokio-rs/console/commit/{{ previous.commit_id }})...\
[{{ commit_id | truncate(length=7, end="") }}](https://github.com/tokio-rs/console/commit/{{ commit_id }})
{% endif %}\
{% endif %}
{% set has_breaking = false -%}
{% for commit in commits -%}
{% if commit.breaking -%}
{% set_global has_breaking = true -%}
{% endif -%}
{% endfor -%}
{% if has_breaking -%}
### <a id = "{{ version }}-breaking"></a>Breaking Changes
{% for commit in commits -%}
{% if commit.breaking -%}
- **{{ commit.message | upper_first }}** ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/tokio-rs/console/commit/{{ commit.id }}))<br />{{ commit.breaking_description }}
{% endif -%}
{% endfor -%}
{% endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**](#{{ version }}-breaking) {% endif -%} {{ commit.message | upper_first }} (\
[{{ commit.id | truncate(length=7, end="") }}](https://github.com/tokio-rs/console/commit/{{ commit.id }})\
{% for link in commit.links -%}
, {{ link.text }}({{ link.href }})\
{% endfor -%}
)\
{% endfor %}
{% endfor %}\n
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = ""
[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 = '^(feat|fix|doc|perf)\((api|subscriber|console)\) ', replace = '${1}(${2}): '}, # fix missing colon after commit type
{ pattern = '^chore: bump tonic', replace = 'update: bump tonic' }, # Upgrading tonic is a breaking change and hence, not a chore
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/tokio-rs/console/issues/${2}))"}, # replace issue numbers
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^doc", group = "Documented" },
{ message = "^perf", group = "Performance" },
{ message = "^update", group = "Updated" },
{ message = "^refactor", skip = true },
{ message = "^refac", skip = true },
{ message = "^style", skip = true },
{ message = "^test", skip = true },
{ message = "^chore\\(release\\)", skip = true },
{ message = "[Pp]repare to release", skip = true },
{ message = "^chore", skip = true },
{ body = ".*security", group = "Security" },
{ body = ".*[dD]eprecate.*", group = "Deprecated" },
# older non-conventional commits
{ message = "^subscriber:", group = "Added" },
{ message = "^console:", group = "Added" },
{ message = "^api:", group = "Added" },
{ message = "^example:", group = "Documented" },
]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
# filter out the commits that are not matched by commit parsers
filter_commits = false
# regex for skipping tags
# skip_tags = "v0.1.0-beta.1"
# regex for ignoring tags
ignore_tags = ""
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
# limit the number of commits included in the changelog.
# limit_commits = 42
link_parsers = [
{ pattern = "[fF]ixes #(\\d+)", text = "fixes [#${1}]", href = "https://github.com/tokio-rs/console/issues/$1"},
{ pattern = "[cC]loses #(\\d+)", text = "closes [#${1}]", href = "https://github.com/tokio-rs/console/issues/$1"},
{ pattern = "[sS]ee #(\\d+)", text = "see [#${1}]", href = "https://github.com/tokio-rs/console/issues/$1"},
]