Files
nudt-compiler-cpp/doc/Git Commit Message 规范.md
2025-12-30 09:46:02 +08:00

55 lines
1.2 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 Commit Message 规范
## 1. 格式
```text
<type>(<scope>): <subject>
```
说明:
- `<type>`:提交类型(必填)
- `<scope>`:影响范围/模块(必填)
- `<subject>`:用一句中文说明“做了什么”(必填)
---
## 2. type 列表
统一使用小写:
| type | 含义 |
|---|---|
| `feat` | 新功能 |
| `fix` | 修复 bug |
| `docs` | 文档变更 |
| `style` | 仅格式/风格(不改语义) |
| `refactor` | 重构(不改变外部行为) |
| `perf` | 性能优化 |
| `test` | 测试相关 |
| `build` | 构建系统 |
| `ci` | CI 相关 |
| `chore` | 杂项维护 |
| `revert` | 回滚提交 |
---
## 3. scope 列表
建议从以下范围中选择(保持一致即可):
| scope | 含义 |
|---|---|
| `frontend` | 前端ANTLR 驱动、AST 构建入口等) |
| `ast` | AST 相关 |
| `sema` | 语义分析(符号表、常量求值等) |
| `ir` | IR 核心结构 |
| `irgen` | AST → IR 生成 |
| `mir` | Machine IR指令选择、寄存器分配、栈帧等 |
| `backend` | 后端目标相关(如需要可细化 `aarch64` |
| `antlr` | 语法文件/ANTLR 相关 |
| `build` | 构建配置 |
| `test` | 测试 |
| `doc` | 文档 |
| `dev` | 开发流程/工具hooks、脚本、规范等 |