-
Notifications
You must be signed in to change notification settings - Fork 2
/
cliff.toml
73 lines (63 loc) · 2.34 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
[changelog]
trim = true
postprocessors = [
{ pattern = '\$REPO', replace = "https://github.com/gibbz00/basic-things" },
]
header = """
# Changelog\n
The format is inspired by the latest version of [Keep a Changelog](https://keepachangelog.com/en), \
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html), \
and generated by levaraging [conventional commits](https://www.conventionalcommits.org/).
"""
body = """
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif -%}
{% macro print_commit(commit) -%}
- {% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | upper_first }} - \
([{{ commit.id | truncate(length=7, end="") }}]($REPO/commit/{{ commit.id }})) - {{ commit.author.name }}
{% endmacro -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits -%}
{% if not commit.scope %}
{{ self::print_commit(commit=commit) }}
{%- endif %}
{%- endfor -%}
{% for group, commits in commits | group_by(attribute="scope") %}
#### {{ group | upper_first }}
{% for commit in commits %}
{{ self::print_commit(commit=commit) }}
{%- endfor -%}
{% endfor -%}\
{% endfor %}
"""
footer = """
"""
[git]
conventional_commits = true
filter_commits = true
filter_unconventional = true
protect_breaking_commits = true
sort_commits = "oldest"
tag_pattern = "[0-9]+.[0-9]+.[0-9]+"
commit_parsers = [
{ message = "^doc", group = "Documented" },
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^perf", group = "Improved" },
{ message = "^revert", group = "Removed" },
# Will be shown if they include breaking changes:
{ message = "^build", group = "Continuous Deployment", skip = true },
{ message = "^chore", group = "Miscellaneous", skip = true },
{ message = "^ci", group = "Continuous Integration", skip = true },
{ message = "^refactor", group = "Refactoring", skip = true },
{ message = "^style", group = "Style", skip = true },
{ message = "^test", group = "Test", skip = true },
]
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](https://github.com/gibbz00/basic-things/issues/${2}))" },
]