-
Notifications
You must be signed in to change notification settings - Fork 18
/
cliff.toml
100 lines (87 loc) · 3.39 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
[remote.github]
owner = "bosun-ai"
repo = "swiftide"
[git]
commit_parsers = [
{ message = "(r|R)elease", skip = true },
{ message = "^(feat|fix|perf|chore)\\(ci\\)", group = "<!-- 3 -->Miscellaneous" },
{ message = "^feat*", group = "<!-- 0 -->New features" },
{ message = "^fix*", group = "<!-- 1 -->Bug fixes" },
{ message = "^perf*", group = "<!-- 2 -->Performance" },
{ message = "^chore*", group = "<!-- 3 -->Miscellaneous" },
]
[changelog]
# changelog header
header = """
# Changelog
All notable changes to this project will be documented in this file.
"""
body = """
{%- if not version %}
## [unreleased]
{% else -%}
## [{{ version }}](https://github.com/bosun-ai/swiftide/releases/tag/{{ version }}) - {{ timestamp | date(format="%Y-%m-%d") }}
{% endif -%}
{% macro commit(commit) -%}
- [{{ commit.id | truncate(length=7, end="") }}]({{ "https://github.com/bosun-ai/swiftide/commit/" ~ commit.id }}) \
{% if commit.scope %}*({{commit.scope | default(value = "uncategorized") | lower }})* {% endif %}\
{%- if commit.breaking %} [**breaking**]{% endif %} \
{{ commit.message | upper_first | trim }}\
{% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}\
{%- if commit.links %} \
in {% for link in commit.links %}[{{link.text}}]({{link.href}}) {% endfor -%}\
{% endif %}
{%- if commit.body and commit.remote.username and commit.remote.username is not containing("[bot]") %}
````text {#- 4 backticks escape any backticks in body #}
{{commit.body | indent(prefix=" ") }}
````
{%- endif %}
{%- if commit.breaking_description %}
**BREAKING CHANGE**: {{ commit.breaking_description }}
{%- endif %}
{% endmacro -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for commit in commits | filter(attribute="scope") | sort(attribute="scope") %}
{{ self::commit(commit=commit) }}
{%- endfor -%}
{% for commit in commits %}
{%- if not commit.scope %}
{{ self::commit(commit=commit) }}
{%- endif -%}
{%- endfor -%}
{%- endfor %}
{%- if github.contributors -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
### New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% endif -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: {{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro remote_url() -%}
{%- if remote.github -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
{% else -%}
https://github.com/bosun-ai/swiftide
{%- endif -%}
{% endmacro %}
""" # template for the changelog body
# https://keats.github.io/tera/docs/#introduction
# note that the - before / after the % controls whether whitespace is rendered between each line.
# Getting this right so that the markdown renders with the correct number of lines between headings
# code fences and list items is pretty finicky. Note also that the 4 backticks in the commit macro
# is intentional as this escapes any backticks in the commit body.
# remove the leading and trailing whitespace from the template
trim = false
# changelog footer