Files
UI/COMMITTING.md
T
2026-10-23 18:48:34 +08:00

68 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Git 提交规范(COMMITTING.md)
> 适用于所有人工提交与自动化迭代提交。`ua commit-lint` 门禁与 `.git/hooks/commit-msg` 钩子按本文校验,违规提交被拒绝。
## 格式
```
<type>(<scope>): <subject>
[body:动机与要点,每行 ≤ 80 字符]
[footer:Refs: <编号> / BREAKING CHANGE: <说明>]
```
## type 枚举
| type | 用途 |
|---|---|
| `feat` | 新功能(组件、命令、插件、门禁) |
| `fix` | 缺陷修复 |
| `docs` | 纯文档变更 |
| `style` | 格式调整(不影响语义:空白、注释格式) |
| `refactor` | 重构(既非新增也非修复) |
| `test` | 测试相关 |
| `chore` | 构建、工具、元数据、依赖 |
| `iter` | 迭代流水线产物(自动化专用,scope 必须为 backlog 条目 id) |
## scope 枚举
- 包名:`table-core` / `frame` / `ui` / `tokens` / `cli`(跨包可省略)
- 应用:`demo` / `docs`
- 元数据:`backlog` / `repo` / `protocol`
- `iter` 提交的 scope 固定为条目 id:`b02`、`c01`、`d29` …
- **scope 强制**:除 Merge/Revert 自动信息外,所有 type 必须带 scope;`ua commit-lint` 已机器校验,裸 type(`chore:` / `docs:`)一律拒绝
## subject 规则
- 中文祈使句,动词开头(「新增…」「修复…」「补充…」);
- ≤ 50 字符;
- 结尾不加句号;
- 条目 id 不写入 subject(scope 已承载,方便 `git log --grep='iter(b02)'` 检索)。
## 示例
```
iter(b02): 新增 toast 消息提示组件
feat(ui): dataTable 新增 selected 受控信号
fix(cli): 修正 style 检查对 URL 中 // 的误判
chore(backlog): 记录 d29 完成
docs: 重写 README 组件清单
```
## 反例(会被门禁拒绝)
```
iter: b02 新增 toast 消息提示组件 ← iter 缺 scope(id)
iter(b02): 文档站 toast 组件的新增。 ← 句号结尾
feat(ui): 增加 dataTable 的受控选中信号并且支持与内核选择双向同步以及已选计数展示 ← 超 50 字符
update stuff ← 非 type 枚举、非中文祈使句
```
## 与流水线的关系
- 自动化每轮迭代的首个提交:`iter(<id>): <subject>`;
- 同轮的元数据变更(backlog 置 done):`chore(backlog): 记录 <id> 完成`;
- 合并提交(qa/stable 的 ff-only)不产生 message,无需遵守;
- 门禁来源:`ua commit-lint <文件|message>`,commit-msg 钩子自动调用;git 自动的 Merge/Revert/fixup 信息跳过校验。