研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
提交消息指南
提交说明
清晰的提交消息使拉取请求更易于查看,并更轻松地生成版本说明。Blockly 项目使用传统提交来帮助实现这一点。
每项提交都应采用以下格式:
<type>: <description>
[optional body]
[optional footer(s)]
请注意,核心 Blockly 代码库有一个提交 linter,可帮助强制执行此检查。如果您的拉取请求有多项提交,linter 将检查标题。如果只有一次提交,它将检查该提交。您的单独提交和拉取请求标题最好遵循这些准则。
类型
类型不得为空,且必须全部为小写。下表列出了可接受的类型。
- 家务
- 适用于完成例行/自动化任务(例如升级依赖项)的提交。
- 弃用
- 对于弃用功能的提交。
- feat
- 适用于向 Blockly 中添加新功能的提交。
- fix
- 适用于修复 Blockly 中的 bug/错误的提交。
- 版本
- 适用于与新版本发布相关的提交。
重大变更
进行破坏性更改的提交应在提交类型后面附加 !
。破坏性更改可能会破坏在其应用中使用 Blockly 的开发者,导致他们不得不执行额外的操作。
例如:fix!: return type of workspace.paste
。
破坏性更改可以具有上述任何有效类型。
说明
说明不得为空,且必须少于 256 个字符。
Body
正文是可选的。如果提供,则它和说明之间应该留有一个空行。必须拆分为不超过 256 个字符的行。
请注意,除了/而不是直接提交之外,建议在拉取请求说明中也包含此类信息。
页脚是可选的。如果提供此属性,其与正文之间应留一个空行。必须分成若干行,且不得超过 256 个字符。
修复非常规提交
如果您在进行修改时没有使用常规提交,则有两种方式可以修复消息,具体取决于您拥有的提交数量:
如果您的拉取请求有多个提交,请修改拉取请求标题以满足要求。合并拉取请求后,其他提交内容将被压缩,以使标题成为提交消息。
如果您的拉取请求只有一项提交,请使用 git commit --amend
修改提交消息,然后将更改强制推送到 Blockly 的分支中。这将自动更新与此分支关联的所有待处理拉取请求。git push --force origin my-branch
.
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2023-12-01。
[null,null,["最后更新时间 (UTC):2023-12-01。"],[[["Blockly utilizes conventional commits to standardize commit messages for improved readability and automation."],["Commit messages should follow the format `\u003ctype\u003e: \u003cdescription\u003e` with optional body and footer, using specific types like `feat`, `fix`, `chore`, etc."],["Breaking changes are indicated by appending `!` to the commit type and require careful consideration due to potential impact on developers."],["Commit messages are limited to 256 characters for descriptions and each line of the body/footer for conciseness."],["Non-conventional commit messages can be fixed by editing the pull request title (for multiple commits) or amending the commit message (for single commit)."]]],["Commit messages should adhere to the format `\u003ctype\u003e: \u003cdescription\u003e`, with optional body and footer. Valid types include `chore`, `deprecate`, `feat`, `fix`, and `release`; breaking changes append `!`. Descriptions must be under 256 characters. To rectify non-compliant messages, edit the pull request title for multiple commits or amend and force-push a single commit using `git commit --amend` and `git push --force`. A linter checks commit messages for each pull request.\n"]]