6.9 编码规范
#
Go规范
#
protobuf规范
#
错误码规范
#
打印日志规范
#
commit规范
#
1
2
3
4
5
| <type>[optional scope]: <description> <类型>[可选 范围]: <描述>
[optional body] [可选 正文]
[optional footer(s)] [可选 脚注]
|
示例:包含了描述并且脚注中有破坏性变更的提交说明
1
2
3
| feat: allow provided config object to extend other configs
BREAKING CHANGE: `extends` key in config file is now used for extending other config files
|
示例:包含了 **!**
字符以提醒注意破坏性变更的提交说明
1
| feat!: send an email to the customer when a product is shipped
|
包含了范围和破坏性变更 **!**
的提交说明
1
2
| feat(api)!: send an email to the customer when a product is shipped
**包含了 **`**!**`** 和 BREAKING CHANGE 脚注的提交说明**
|
1
2
3
4
| chore!: drop support for Node 6
BREAKING CHANGE: use JavaScript features not available in Node 6.
**不包含正文的提交说明**
|
1
| docs: correct spelling of CHANGELOG
|
包含范围的提交说明
1
| feat(lang): add polish language
|
包含多行正文和多行脚注的提交说明
1
2
3
4
5
6
7
8
9
10
| fix: prevent racing of requests
Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.
Remove timeouts which were used to mitigate the racing issue but are
obsolete now.
Reviewed-by: Z
Refs: #123
|
- “必须(MUST)”、“禁止(MUST NOT)”、“必要(REQUIRED)”、“应当(SHALL)”、“不应当(SHALL NOT)”、“应该(SHOULD)”、“不应该(SHOULD NOT)”、“推荐(RECOMMENDED)”、“可以(MAY)” 和 “可选(OPTIONAL)”
语义化版本号规范
#
- 语义化版本:
https://semver.org/lang/zh-CN/
- 版本格式:主版本号.次版本号.修订号,版本号递增规则如下:
- 主版本号:当你做了不兼容的 API 修改,
- 次版本号:当你做了向下兼容的功能性新增,
- 修订号:当你做了向下兼容的问题修正。
- 语义化版本控制规范(SemVer)
- 主版本号为零(0.y.z)的软件处于开发初始阶段,一切都可能随时被改变。这样的公共 API 不应该被视为稳定版
- …