Repository navigation
Expand file tree
/
Copy pathcliff.toml
More file actions
96 lines (85 loc) · 3.71 KB
/
Copy pathcliff.toml
File metadata and controls
96 lines (85 loc) · 3.71 KB
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
# Configuration for git-cliff changelog generation
# https://git-cliff.org/docs/configuration
#
# "### category" from the commit type, "#### audience" from the scope.
# Category order comes from the "<!-- NN -->" prefixes, which the template strips.
[changelog]
header = ""
body = """
{%- macro list(commits) -%}
{%- for commit in commits %}
- {{ commit.message | split(pat="\n") | first | trim }}
{%- endfor -%}
{%- endmacro -%}
{%- macro audience(commits, scopes, heading) -%}
{%- set_global picked = [] -%}
{%- for scope in scopes -%}
{%- set_global picked = picked | concat(with=commits | filter(attribute="scope", value=scope)) -%}
{%- endfor -%}
{%- if picked | length > 0 %}
#### {{ heading }}
{{- self::list(commits=picked) -}}
{%- endif -%}
{%- endmacro -%}
{#- Scopes mapped to an audience heading; anything else is "Other". -#}
{%- set FIRMWARE = ["firmware", "fw", "radio"] -%}
{%- set TELEMETRY = ["telem", "telemetry"] -%}
{%- set LUA = ["lua"] -%}
{%- set BW = ["bw", "bw128", "bw212"] -%}
{%- set COLOR = ["color", "colour", "colorlcd"] -%}
{%- set COMPANION = ["cpn", "companion"] -%}
{%- set MAPPED = FIRMWARE | concat(with=TELEMETRY) | concat(with=LUA) | concat(with=BW) | concat(with=COLOR) | concat(with=COMPANION) -%}
{%- for group, commits in commits | group_by(attribute="group") %}
### {{ group | split(pat="-->") | last | trim }}
{{- self::audience(commits=commits, scopes=FIRMWARE, heading="🎮 Firmware") -}}
{{- self::audience(commits=commits, scopes=TELEMETRY, heading="📡 Telemetry") -}}
{{- self::audience(commits=commits, scopes=LUA, heading="📜 Lua") -}}
{{- self::audience(commits=commits, scopes=BW, heading="🖥️ Black & White Radio") -}}
{{- self::audience(commits=commits, scopes=COLOR, heading="🎨 Color LCD Radio") -}}
{{- self::audience(commits=commits, scopes=COMPANION, heading="💻 Companion") -}}
{%- set_global other = [] -%}
{%- for commit in commits -%}
{%- if commit.scope | default(value="") not in MAPPED -%}
{%- set_global other = other | concat(with=[commit]) -%}
{%- endif -%}
{%- endfor -%}
{%- if other | length > 0 %}
#### 📦 Other
{{- self::list(commits=other) -}}
{%- endif -%}
{%- endfor %}
"""
trim = true
[git]
conventional_commits = true
filter_unconventional = false
# Only look for release and rc tags; the moving nightly tag on main would
# otherwise split the changelog in two
tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+(-rc[0-9]+)?$"
# Ensures it looks at the branch structure
topo_order = true
# Respect the nearest tag on current branch
use_branch_tags = true
# Ensure it sorts from the tag forward
sort_commits = "oldest"
# First match wins. Patterns require "(#1234)" on the subject line, so direct
# pushes are dropped; "." does not span newlines, so a body mention will not do.
commit_parsers = [
# Tag new radios with the newradio scope, e.g. "feat(newradio): Jumper T22".
{ message = "^feat\\(newradio\\).*\\(#[0-9]+\\)", group = "<!-- 00 -->🆕 New Radio Support" },
# Not user facing.
{ message = "^ci", skip = true },
{ message = "^build", skip = true },
{ message = "^test", skip = true },
{ message = "^style", skip = true },
{ message = "^feat.*\\(#[0-9]+\\)", group = "<!-- 01 -->🚀 Features" },
{ message = "^fix.*\\(#[0-9]+\\)", group = "<!-- 02 -->🐛 Bug Fixes" },
{ message = "^perf.*\\(#[0-9]+\\)", group = "<!-- 03 -->⚡ Performance" },
{ message = "^chore.*\\(#[0-9]+\\)", group = "<!-- 04 -->🧹 Chores" },
{ message = "^refactor.*\\(#[0-9]+\\)", group = "<!-- 04 -->🧹 Chores" },
{ message = "^docs?.*\\(#[0-9]+\\)", group = "<!-- 05 -->📝 Documentation" },
# From a PR, but not a conventional title.
{ message = ".*\\(#[0-9]+\\)", group = "<!-- 06 -->📦 Other" },
# No PR reference - direct push.
{ message = ".*", skip = true },
]