-
Notifications
You must be signed in to change notification settings - Fork 22
/
cliff.toml
104 lines (92 loc) · 3.68 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
[changelog]
# changelog header
header = """
# Changelog
[//]: # "DO NOT EDIT THIS FILE MANUALLY"
[//]: # "This file is automatically generated using git-cliff"
[//]: # "See here for more information: https://git-cliff.org"
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).
"""
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
{% macro print_commit(commit) -%}
- {% if commit.body %}<details>
{% raw %} {% endraw %}<summary>{% endif %}\
{% if commit.scope %}<em>({{ commit.scope }})</em> {% endif %}\
{{ commit.message }} \
(\
<a href="<REPO>/commits/{{ commit.id }}">{{ commit.id | truncate(length=7, end='') }}</a>\
{%- for issue in commit.footers | filter(attribute='separator', value=' #') -%}
, <a href="<REPO>/issues/{{ issue.value }}">#{{ issue.value }}</a>\
{%- endfor -%}
)\
{%- if commit.body -%}
{%- set body = commit.body | indent(prefix=' ', blank=true) -%}
{%- if '```' not in commit.body -%}
{% set body = body | replace(from='\n', to='<br>\n') -%}
{%- endif -%}
</summary>
{% raw %} {% endraw %}<blockquote>
{% raw %} {% endraw %}{{ body }}
{% raw %} {% endraw %}</blockquote>
{% raw %} {% endraw %}</details>
{%- endif -%}
{%- if commit.breaking -%}
{% raw %} {% endraw %}- **BREAKING**: {{commit.breaking_description}}
{%- endif -%}
{% endmacro print_commit -%}
{% set issues = [] %}
{%- for commit in commits -%}
{%- for issue in commit.footers | filter(attribute='separator', value=' #') -%}
{% set_global issues = issues | concat(with = '[#'~issue.value~'](<REPO>/issues/'~issue.value~')') %}
{%- endfor -%}
{%- endfor -%}
## [{{ version | default(value='Unreleased') | trim_start_matches(pat='v') }}] - {{ timestamp | date(format='%Y-%m-%d') }}
{% if message %}
{{ message }}
{% endif %}
{% if issues | length > 0 %}Issues: {{ issues | sort | unique | join(sep=', ') }}{% raw %}\n {% endraw%}{% endif %}
{%- for group, commits in commits | group_by(attribute='group') %}
### {{ group }}
{% for commit in commits
| filter(attribute='scope')
| sort(attribute='scope') %}
{{ self::print_commit(commit=commit) }}
{%- endfor -%}
{% raw %}\n{% endraw %}\
{% for commit in commits %}
{%- if commit.scope -%}{% continue %}{%- endif -%}
{{ self::print_commit(commit=commit) }}
{% endfor -%}
{% endfor %}\n\n
"""
# remove the leading and trailing whitespace from the template
trim = true
postprocessors = [
{ pattern = '<REPO>', replace = 'https://github.com/muja/unrar.rs' }
]
[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
filter_commits = true
commit_parsers = [
{ message = "^fix", group = "<!--1-->Bug Fixes" },
{ message = "^feat", group = "<!--2-->Features" },
{ message = "^perf", group = "<!--3-->Performance" },
{ message = "^test", group = "<!--5-->Testing" },
{ message = "^doc", group = "<!--6-->Documentation" },
{ message = ".*example", group = "<!--7-->Example" },
{ message = "^style", group = "<!--8-->Styling" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^.*\\bv[0-9]+\\.", skip = true },
{ message = "^chore|^ci|^refactor", group = "<!--4-->Miscellaneous / Refactors" },
{ body = ".*security", group = "<!--2-->Security" },
{ message = "^revert", group = "<!--9-->Revert" },
]