-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. add links between README.md and README-ZH.md . 2. add guide fro commit msg. Co-authored-by: flylchen <[email protected]>
- Loading branch information
Showing
3 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,103 @@ | ||
# Commit规范 | ||
|
||
在对项目作出更改后,我们需要生成 commit 来记录自己的更改。以下是参照 Angular 对 commit 格式的规范: | ||
|
||
## (1) 格式 | ||
|
||
提交信息包括三个部分:`Header`,`Body` 和 `Footer`。 | ||
|
||
``` | ||
<Header> | ||
<Body> | ||
<Footer> | ||
``` | ||
|
||
其中,Header 是必需的,Body 和 Footer 可以省略。 | ||
|
||
#### 1> Header | ||
|
||
Header 部分只有一行,包括俩个字段:`type`(必需)和`subject`(必需)。 | ||
|
||
``` | ||
<type>: <subject> | ||
``` | ||
|
||
**type** | ||
|
||
type 用于说明 commit 的类别,可以使用如下类别: | ||
|
||
- feat:新功能(feature) | ||
- fix:修补bug | ||
- doc:文档(documentation) | ||
- style: 格式(不影响代码运行的变动) | ||
- refactor:重构(即不是新增功能,也不是修改bug的代码变动) | ||
- test:增加测试 | ||
- chore:构建过程或辅助工具的变动 | ||
|
||
**subject** | ||
|
||
subject 是 commit 目的的简短描述。 | ||
|
||
- 以动词开头,使用第一人称现在时,比如改变,而不是改变了。 | ||
- 结尾不加句号(。) | ||
|
||
#### 2> Body | ||
|
||
Body 部分是对本次 commit 的详细描述,可以分成多行。下面是一个范例。 | ||
|
||
``` | ||
More detailed explanatory text, if necessary. Wrap it to | ||
about 72 characters or so. | ||
Further paragraphs come after blank lines. | ||
- Bullet points are okay, too | ||
- Use a hanging indent | ||
``` | ||
|
||
**注意:**应该说明代码变动的动机,以及与以前行为的对比。 | ||
|
||
#### 3> Footer | ||
|
||
Footer 部分应该包含:(1)Breaking Changes; (2)关闭 issue; | ||
|
||
**Breaking Changes**: | ||
|
||
如果当前代码与上一个版本不兼容,则 Footer 部分以`BREAKING CHANGE`开头,后面是对变动的描述、以及变动理由和迁移方法。这种使用较少,了解即可。 | ||
|
||
**Issue 部分:** | ||
|
||
- 通过 commit 关联 issue: | ||
|
||
如果当前提交信息关联了某个 issue,那么可以在 Footer 部分关联这个 issue: | ||
|
||
``` | ||
issue #2 | ||
``` | ||
|
||
- 通过 commit 关闭 issue,当提交到**默认分支**时,提交信息里可以使用 `fix/fixes/fixed` , `close/closes/closed` 或者 `resolve/resolves/resolved`等关键词,后面再跟上 issue 号,这样就会关闭这个 issue: | ||
|
||
``` | ||
Closes #1 | ||
``` | ||
|
||
注意,如果不是提交到默认分支,那么并不能关闭这个 issue,但是在这个 issue 下面会显示相关的信息表示曾经想要关闭这个 issue,当这个分支合并到默认分支时,就可以关闭这个 issue 了。 | ||
|
||
#### 4> 例子 | ||
|
||
下面是一个完整的例子: | ||
|
||
``` | ||
feat: agent 支持上传完整的 ouptput 到 COS. | ||
agent 支持上传完成的 output 到 COS. | ||
- 新增了 COS rust sdk. | ||
- store.rs 支持存储 output 到文件. | ||
Issue #1, #2 | ||
Closes #1 | ||
``` | ||
|
This file contains 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
简体中文 | [English](./README.md) | ||
|
||
# 自动化助手 TAT | ||
|
||
TAT 自动化助手是由 Rust 编写,是一款可在 CVM、Lighthouse 和其他云服务器中部署的原生运维部署工具。 | ||
|
This file contains 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