cursor-init/docs/git-commit-rules.md

55 lines
1.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.

---
description:
globs:
alwaysApply: true
---
## Git 提交规范Commit Message Rules
1. **提交格式**
```
<type>(<scope>): <subject>
```
- `type`:提交类型(必填)
- `scope`:影响范围(可选)
- `subject`:简要描述(必填)
2. **type 类型**
- feat新功能
- fix修复 bug
- docs文档变更
- style代码格式不影响功能例如空格、分号等
- refactor代码重构既不是新增功能也不是修复 bug
- perf性能优化
- test增加或修改测试
- chore构建过程或辅助工具的变动
- revert回滚某个提交
3. **scope 范围**
- 用于说明 commit 影响的模块或文件(如 user、api、core 等),可省略。
4. **subject 描述**
- 简明扼要,建议不超过 50 字符
- 以动词开头,首字母小写
- 结尾不加句号
5. **正文body**
- 可选,详细描述本次提交的内容、动机、对比信息等
- 建议每行不超过 72 字符
6. **Footer**
- 可选,用于关联 issue 或进行破坏性变更说明
- 例如:`BREAKING CHANGE: xxx` 或 `Closes #123`
### 示例
```
feat(user): 新增用户登录功能
fix(api): 修复获取数据时的空指针异常
docs(readme): 更新安装说明
refactor(core): 优化数据处理逻辑
chore: 升级依赖包
```