Repository navigation
Expand file tree
/
Copy pathcliff.toml
More file actions
150 lines (134 loc) · 6.31 KB
/
Copy pathcliff.toml
File metadata and controls
150 lines (134 loc) · 6.31 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Shared git-cliff configuration
# https://git-cliff.org/docs/configuration
# Materialized from research-repo-tools 0.1.7; only the deps-dev body condition
# below differs from the packaged template. See scripts/README.md.
[changelog]
# Keep a Changelog header
header = """
# Changelog\n
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
"""
# Tera template for each release section.
#
# Release sections are generated from commit ranges. The normalizer escapes
# prose angle brackets after protecting Markdown code, so Rust generics remain
# literal inside code spans and fences. Breaking footers are separate from
# commit.body; render their full descriptions before grouping ordinary entries.
body = """
{% 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 %}
{% if commit.breaking_description and commit.breaking_description != commit.message %}
- {{ commit.breaking_description | trim | indent(prefix=" ", first=false) }}
{% else %}
- {{ commit.message | split(pat="\n") | first | upper_first | trim }}
{% endif %}
{% endfor %}
{% endif %}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.breaking %}[**breaking**] {% endif %}\
{{ commit.message | split(pat="\n") | first | upper_first | trim }} \
[`{{ commit.id | truncate(length=7, end="") }}`]\
(https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/commit/{{ commit.id }})
{%- if commit.body and (group != "Dependencies" or commit.scope == "deps-dev") %}
{{ commit.body | indent(prefix=" ", first=true) }}
{%- endif %}
{%- endfor %}
{% endfor %}\n
"""
# Compare-link footer (requires [remote.github] below)
footer = """
{% for release in releases -%}
{% if release.version -%}
{% if release.previous.version -%}
[{{ release.version | trim_start_matches(pat="v") }}]: \
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/compare/{{ release.previous.version }}...{{ release.version }}
{% else -%}
[{{ release.version | trim_start_matches(pat="v") }}]: \
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/tree/{{ release.version }}
{% endif -%}
{% else -%}
{% if release.previous.version -%}
[Unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/compare/{{ release.previous.version }}...HEAD
{% else -%}
[Unreleased]: https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}\
/commits/HEAD
{% endif -%}
{% endif -%}
{% endfor -%}
"""
trim = true
# Collapse 3+ consecutive newlines into exactly 2 (one blank line).
# This prevents MD012 violations from Tera template whitespace artifacts.
postprocessors = [
{ pattern = '\n{3,}', replace = "\n\n" },
]
[git]
conventional_commits = true
# Include non-conventional commits so we capture the full history
# (mixed styles: "feat:", "Changed:", plain merge commits, dependency bumps).
filter_unconventional = false
filter_commits = false
protect_breaking_commits = true
# Expanded from the package's shared SemVer grammar when this template is read.
tag_pattern = '\Av(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-(?:(?:0|[1-9][0-9]*)|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:(?:0|[1-9][0-9]*)|[0-9A-Za-z-]*[A-Za-z-][0-9A-Za-z-]*))*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?\z'
topo_order = false
sort_commits = "oldest"
# Link (#N) references to GitHub PRs before rendering.
# NOTE: The repo path is hardcoded here because commit_preprocessors run before
# Tera template rendering, so {{ remote.github.owner }} variables are not
# available. The body/footer templates above do use the remote.github variables.
commit_preprocessors = [
{ pattern = '(?m)^Closes #\d+\n\n', replace = "" },
{ pattern = '\(#(\d+)\)', replace = '[#${1}](https://github.com/acgetchell/la-stack/pull/${1})' },
]
commit_parsers = [
# Skip merge commits and release-prep noise from the changelog body.
{ message = "^Merge pull request", skip = true },
{ message = "^Merge branch", skip = true },
{ message = '(?i)^(chore(:|\(release\):) |Changed: )?(prepare|release) v[0-9]', skip = true },
# Dependency bumps: keep all bump commits so archived release history
# preserves CI/action/tooling dependency updates as well as Rust crates.
{ message = "^chore\\(deps(?:-[^)]+)?\\)!?: bump ", group = "Dependencies" },
{ message = "(?i)^bump\\s+(deps?\\b|dependencies\\b|[A-Za-z0-9_.-]+/[A-Za-z0-9_./-]+|[A-Za-z0-9_.-]+\\s+from\\s+)", group = "Dependencies" },
# Conventional commit types
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^perf", group = "Performance" },
{ message = "^refactor", group = "Changed" },
{ message = "^docs?", group = "Documentation" },
{ message = "^test", group = "Changed" },
{ message = "^style", group = "Changed" },
{ message = "^build", group = "Maintenance" },
# Historical non-conventional commit categories
{ message = "(?i)^add", group = "Added" },
{ message = "(?i)^support", group = "Added" },
{ message = "(?i)^implement", group = "Added" },
{ message = "(?i)^deprecate", group = "Deprecated" },
{ message = "(?i)^remove", group = "Removed" },
{ message = "(?i)^delete", group = "Removed" },
{ message = "(?i)^change", group = "Changed" },
{ message = "(?i)^update", group = "Changed" },
{ message = "(?i)^fix", group = "Fixed" },
# Chore / CI
{ message = "^chore|^ci", group = "Maintenance" },
# Catch-all
{ message = ".*", group = "Changed" },
]
[remote.github]
owner = "acgetchell"
repo = "la-stack"