forked from warpdotdev/warp
-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathcliff.toml
More file actions
88 lines (75 loc) · 3.82 KB
/
Copy pathcliff.toml
File metadata and controls
88 lines (75 loc) · 3.82 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
# git-cliff 配置 — 用于在 Zap Release 发布时自动生成「自上个 tag 以来的变更」。
#
# 设计原则:
# - 主分组按 conventional commit type(feat/fix/refactor/docs/test/build/ci/ui/perf/chore)。
# - scope 以加粗前缀 `**(scope)**` 形式保留,便于按子系统快速扫读(ai/ssh/i18n/linux/...)。
# - Merge commit、纯 chore(release)、Revert 等噪声直接 skip。
# - 非 conventional commit 落到「其他」分组兜底,不丢信息但也不污染主分组。
# - 输出纯片段(不带 H1 标题与日期块),由 workflow 拼到 release_body 顶部说明之后。
[changelog]
# 顶部不输出 `# Changelog` 大标题;由 publish_release 步骤负责整体排版。
header = ""
body = """
{%- if previous %}
{%- if previous.version %}
**变更范围**: [`{{ previous.version }}` … `{{ version }}`]({{ self::compare_url(prev=previous.version, curr=version) }})
{% endif -%}
{%- endif -%}
{% for group, commits in commits | group_by(attribute="group") %}
### {{ group | upper_first }}
{% for commit in commits -%}
- {% if commit.scope %}**({{ commit.scope }})** {% endif %}{{ commit.message | split(pat="\n") | first | trim }}{% if commit.id %} ([`{{ commit.id | truncate(length=7, end="") }}`]({{ self::commit_url(sha=commit.id) }})){% endif %}
{% endfor %}
{% endfor %}
{%- macro compare_url(prev, curr) -%}
https://github.com/zerx-lab/warp/compare/{{ prev }}...{{ curr }}
{%- endmacro -%}
{%- macro commit_url(sha) -%}
https://github.com/zerx-lab/warp/commit/{{ sha }}
{%- endmacro -%}
"""
# tag 之间的对比页脚由模板里的 compare_url 输出,这里不再额外追加 footer。
footer = ""
trim = true
[git]
# 不解析 conventional commits 失败时不报错;落到 commit_parsers 的兜底分组。
conventional_commits = true
filter_unconventional = false
# 不拆分多行 body — 一条 commit 一条记录。
split_commits = false
# tag 命名:v 前缀 + 任意尾巴(v2026.05.27.2 / v2026.05.06.preview / v2026.05.21.zaptest01)。
tag_pattern = "v[0-9].*"
# 顺序按 commit 在 git log 中出现的顺序(新 → 旧),保持可读性。
topo_order = false
sort_commits = "newest"
# 忽略归并 / 内部 release tag 这类对用户无意义的 commit。
commit_preprocessors = [
# 去掉首行末尾的 PR 编号括号,避免 `(#171)` 与下文 hash 链接重复显示。
# 用 `(?m)` 让 `$` 锚到每行末尾(commit subject 是第一行),而不是整段 message 末尾。
{ pattern = '(?m) \(#[0-9]+\)$', replace = "" },
# 去掉 commit subject 开头的 gitmoji 前缀(如 "♻️ refactor: ..."),
# 否则后续 `^refactor` 这类分组规则无法命中,会落到「其他」。
{ pattern = '^(♻️|✨|🐛|🎨|🚀|🔥|💄|📝|🛠|⚡|🚧|🐳|🔧|🚨|✅|♿|🔒)[️]?\s*', replace = "" },
]
# 顺序敏感:第一个匹配生效。把噪声 skip 放最前面。
commit_parsers = [
# 噪声:跳过
{ message = "^[Mm]erge ", skip = true },
{ message = "^[Rr]evert ", skip = true },
{ message = "^[Bb]ump ", skip = true },
{ message = "^chore\\(release\\)", skip = true },
{ message = "^chore: release", skip = true },
{ message = "^v[0-9]+\\.", skip = true },
# conventional commit 主分组(中文标题,顺序就是渲染顺序)
{ message = "^feat", group = "✨ 新功能" },
{ message = "^fix", group = "🐛 修复" },
{ message = "^perf", group = "⚡ 性能" },
{ message = "^refactor", group = "♻️ 重构" },
{ message = "^ui", group = "🎨 界面" },
{ message = "^style", group = "🎨 界面" },
{ message = "^test", group = "🧪 测试" },
{ message = "^docs", group = "📝 文档" },
{ message = "^(build|ci|chore)", group = "🛠 基建与杂项" },
# 兜底:其余形态的 commit 也保留下来,放到「其他」分组,避免漏掉非规范提交。
{ message = ".*", group = "📦 其他" },
]