-
Notifications
You must be signed in to change notification settings - Fork 1
chore(commit-rule): add git commit message specification document #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ff0f6b1
chore(commit-rule): add git commit message specification document
Aibeto 04e67ed
revert & docs(git-commit-rule): revert accidental commit and update p…
Aibeto b7c1102
revert: delete outdated git commit message rule document
Aibeto 5625198
revert: revert the revert.
Aibeto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| --- | ||
| alwaysApply: true | ||
| scene: git_message | ||
| --- | ||
|
|
||
| ## 提交信息 | ||
|
|
||
| 项目采用 Conventional Commits 规范来格式化提交信息。 | ||
|
|
||
| ### 基本格式 | ||
|
|
||
| 每条提交信息应遵循以下结构(只允许使用英文): | ||
|
|
||
| ```text | ||
| <类型>(<作用域>): <描述> | ||
|
|
||
| [正文] | ||
|
|
||
| [脚注] | ||
| ``` | ||
|
|
||
| - **类型**:必填,表示本次提交的类别(见下文“类型列表”)。 | ||
| - **作用域**:可选,用括号包裹,指明本次提交影响的代码范围(如模块名、组件名等)。 | ||
| - **描述**:必填,是对变更的简短说明,使用祈使句、现在时态,首字母小写,末尾不加句号。 | ||
| - **正文**:可选,对变更动机及与之前行为的对比进行详细说明。 | ||
| - **脚注**:可选,主要用于关联 Issue 或标记破坏性变更(BREAKING CHANGE)。 | ||
|
|
||
| ### 示例 | ||
|
|
||
| 1. 新增一个用户登录功能: | ||
|
|
||
| ```text | ||
| feat(auth): add user login endpoint | ||
| ``` | ||
|
|
||
| 2. 包含破坏性变更的提交(需在脚注中标记): | ||
|
|
||
| ```text | ||
| feat(api): change response format for user details | ||
|
|
||
| BREAKING CHANGE: The 'user' field in the response is now nested under 'data'. | ||
| ``` | ||
|
|
||
| ### 允许的类型列表 | ||
|
|
||
| - `feat`:新增功能。 | ||
| - `fix`:修复 bug。 | ||
| - `update`: 对代码内容做出调整,而原先的代码不视为 bug(如修改前端按钮的文案) | ||
| - `docs`:仅修改文档。 | ||
| - `style`:修改代码格式(不影响代码运行的变动,如空格、分号缺失等)。 | ||
| - `refactor`:重构代码(既不是新增功能,也不是修改 bug 的代码变动)。 | ||
| - `perf`:优化性能。 | ||
| - `test`:增加测试或修改现有测试。 | ||
| - `ci`:修改 CI 配置文件或脚本(例如:Travis, Circle, BrowserStack, SauceLabs)。 | ||
| - `chore`:其他不修改源代码或测试文件的更改。 | ||
| - `revert`:撤销之前的提交。 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: project-cvsa/cvsa
Length of output: 234
🏁 Script executed:
Repository: project-cvsa/cvsa
Length of output: 132
🏁 Script executed:
Repository: project-cvsa/cvsa
Length of output: 531
🏁 Script executed:
Repository: project-cvsa/cvsa
Length of output: 885
Align the language of format template placeholders with the required English commit message format.
The file requires commit messages to be English-only ("只允许使用英文"), but the format template on line 15 uses Chinese placeholders:
<类型>(<作用域>): <描述>.Replace these with English equivalents (e.g.,
<type>(<scope>): <description>) to match the requirement and avoid confusion.🤖 Prompt for AI Agents