Repository navigation
Expand file tree
/
Copy pathcliff.toml
More file actions
91 lines (81 loc) · 3.31 KB
/
Copy pathcliff.toml
File metadata and controls
91 lines (81 loc) · 3.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
# git-cliff config — generates Keep-a-Changelog sections from
# Conventional Commits.
#
# Usage:
# make changelog VERSION=1.0.2 # render `[1.0.2]` section to stdout
# git-cliff --unreleased --tag v1.0.2 --prepend CHANGELOG.md
#
# Install once:
# cargo install git-cliff --locked # macOS: brew install git-cliff
#
# Mapping (commit type → CHANGELOG section):
# feat: → Added
# fix: → Fixed
# refactor:, perf: → Changed
# <type>!: → Changed + ⚠️ BREAKING marker
# chore(deps): → Changed (Renovate PRs surface here)
# chore(release): → skip (the version-bump commits the release flow makes)
# chore (other): → skip (internal noise)
# docs:, test:, ci:, build:, style: → skip
#
# Anything with `BREAKING CHANGE:` in the body is force-promoted to
# Changed and flagged regardless of type prefix.
[changelog]
# Final structure: `## [<version>] — <date>` header, one h3 per
# CHANGELOG section, blank line between groups so Keep-a-Changelog
# parsers stay happy. We deliberately DON'T emit "Unreleased" headers
# — git-cliff's --tag flag pins the version explicitly.
header = ""
body = """
{% if version %}\
## [{{ version | trim_start_matches(pat="v") }}] — {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## [Unreleased]
{% endif %}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group }}
{% for commit in commits %}- {% if commit.breaking %}⚠️ **BREAKING:** {% endif %}{{ commit.message | split(pat="\\n") | first | trim }}{% if commit.scope %} *({{ commit.scope }})*{% endif %}
{% endfor %}
{% endfor %}
"""
trim = true
footer = ""
[git]
# Conventional Commits is enabled — unconventional commits are
# kept in the log for grep but never grouped into the rendered
# CHANGELOG sections.
conventional_commits = true
filter_unconventional = true
require_conventional = false
commit_parsers = [
# Breaking changes — force-promote regardless of type prefix.
{ body = ".*BREAKING CHANGE.*", group = "Changed" },
# Standard mappings.
{ message = "^feat", group = "Added" },
{ message = "^fix", group = "Fixed" },
{ message = "^perf", group = "Changed" },
{ message = "^refactor", group = "Changed" },
# Special-case chore variants.
{ message = "^chore\\(release\\)", skip = true }, # auto version bumps
{ message = "^chore\\(deps\\)", group = "Changed" }, # Renovate PRs
{ message = "^chore", skip = true },
# Noise the CHANGELOG doesn't need.
{ message = "^docs", skip = true },
{ message = "^test", skip = true },
{ message = "^ci", skip = true },
{ message = "^build", skip = true },
{ message = "^style", skip = true },
# Security advisories — usually appear with `fix:` prefix but
# call them out explicitly when the body mentions a CVE or
# `security:` scope.
{ message = ".*security.*", group = "Security" },
{ body = ".*CVE-\\d{4}-\\d+.*", group = "Security" },
]
# Only consider commits since the last `v*` tag — git-cliff's
# default mode is "everything"; this scopes generation to "what
# changed since the previous release", which is the only thing the
# CHANGELOG ever wants.
filter_commits = true
tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+"
# Most-recent first inside each section.
sort_commits = "newest"