Repository navigation
Expand file tree
/
Copy pathcliff.toml
More file actions
136 lines (123 loc) · 5.69 KB
/
Copy pathcliff.toml
File metadata and controls
136 lines (123 loc) · 5.69 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
[remote.github]
owner = "radius-project"
repo = "radius"
[changelog]
header = """
# Changelog
All notable changes to Radius are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), with Radius-specific change groups and contributor sections. Radius follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html) with the version policy documented in the [release process](docs/contributing/contributing-releases/README.md).\n
"""
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{%- macro profile_link(username) -%}
[@{{ username }}](https://github.com/{% if username is ending_with("[bot]") %}apps/{{ username | trim_end_matches(pat="[bot]") }}{% else %}{{ username }}{% endif %})
{%- endmacro -%}
{#- One changelog line per commit. Squash merges end the subject with the pull
request number, for example "Fix the thing (#123)". When the GitHub
integration knows the pull request, that suffix is dropped and the number is
rendered once, as a link; offline renders keep the plain suffix. The pull
request author is preferred over the commit author, which a squash merge can
resolve to the merging account. -#}
{%- macro entry(commit) -%}
{%- set subject = commit.message | split(pat="\n") | first -%}
{%- if commit.remote.pr_number -%}
{%- set suffix = " (#" ~ commit.remote.pr_number ~ ")" -%}
{%- set subject = subject | replace(from=suffix, to="") -%}
{%- endif -%}
{{ subject | upper_first | trim }}{% if commit.remote.pr_author or commit.remote.username %} by {{ self::profile_link(username=commit.remote.pr_author | default(value=commit.remote.username)) }}{% endif %}{% if commit.remote.pr_number %} in [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}){% endif %}
{%- endmacro -%}
{% if version -%}
## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
{% else -%}
## [Unreleased]
{% endif %}
{% set breaking_commits = commits | filter(attribute="breaking", value=true) %}
{% if breaking_commits | length != 0 %}
### Breaking changes
{% for commit in breaking_commits -%}
- {{ self::entry(commit=commit) }}
{% endfor %}
{% endif %}
{% set_global normal_commits = [] %}
{% for commit in commits %}
{% if not commit.breaking | default(value=false) %}
{% set_global normal_commits = normal_commits | concat(with=[commit]) %}
{% endif %}
{% endfor %}
{% for group, commits in normal_commits | group_by(attribute="group") %}
### {{ group | striptags | trim }}
{% for commit in commits -%}
- {{ self::entry(commit=commit) }}
{% endfor %}
{% endfor %}
{% if github %}
{% set contributors = github.contributors | filter(attribute="username") %}
{% if contributors | length != 0 %}
### Contributors
{% for contributor in contributors -%}
{{ self::profile_link(username=contributor.username) }}{% if not loop.last %}, {% endif %}
{%- endfor %}
{% endif %}
{% if contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
### New contributors
{% for contributor in contributors | filter(attribute="is_first_time", value=true) -%}
- {{ self::profile_link(username=contributor.username) }} made their first contribution{% if contributor.pr_number %} in [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}){% endif %}
{% endfor %}
{% endif %}
{% endif %}
"""
footer = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% for release in releases -%}
{% if release.version -%}
{% if release.previous.version -%}
[{{ release.version | trim_start_matches(pat="v") }}]: {{ self::remote_url() }}/compare/{{ release.previous.version }}...{{ release.version }}
{% else -%}
[{{ release.version | trim_start_matches(pat="v") }}]: {{ self::remote_url() }}/releases/tag/{{ release.version }}
{% endif -%}
{% else -%}
{% if release.previous.version -%}
[Unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}...HEAD
{% endif -%}
{% endif -%}
{% endfor %}
<!-- generated by git-cliff -->
"""
trim = true
render_always = true
postprocessors = [{ pattern = '\n{3,}', replace = "\n\n" }]
[git]
conventional_commits = true
filter_unconventional = false
require_conventional = false
split_commits = false
commit_parsers = [
# Classify unparsed subjects before type-based rules can mislabel them.
{ field = "conventional", pattern = "^false$", group = "<!-- 6 -->Others", default_scope = "other" },
# Dependabot is configured in .github/dependabot.yml (synced from
# radius-project/.github) with the `ci` and `chore` prefixes plus `include: scope`,
# so dependency updates arrive as `ci(deps):` and `chore(deps):`. Match them
# before the Others fallback so they retain their specialized group.
{ message = "^(?:chore|ci)\\(deps\\)", group = "<!-- 4 -->Dependencies" },
{ message = "^feat(?:\\([^)]*\\))?!?:", group = "<!-- 1 -->Added" },
{ message = "^fix(?:\\([^)]*\\))?!?:", group = "<!-- 2 -->Fixed" },
{ message = "^perf(?:\\([^)]*\\))?!?:", group = "<!-- 3 -->Changed" },
{ message = "^refactor(?:\\([^)]*\\))?!?:", group = "<!-- 3 -->Changed" },
{ message = "^revert(?:\\([^)]*\\))?!?:", group = "<!-- 5 -->Reverted changes" },
# Retain every other parsed conventional type, including maintenance changes.
{ field = "conventional", pattern = "^true$", group = "<!-- 6 -->Others" },
]
protect_breaking_commits = true
filter_commits = false
fail_on_unmatched_commit = false
tag_pattern = "^v[0-9]+\\.[0-9]+\\.[0-9]+(?:-rc(?:\\.[0-9]+|[0-9]+))?$"
topo_order = true
topo_order_commits = true
sort_commits = "newest"
link_parsers = [
{ pattern = "#(\\d+)", href = "https://github.com/radius-project/radius/issues/$1" },
]