cloud-category-commit-rules
v1.0.3
Published
Commitizen adapter formatting commit messages for baidu cloud category.
Downloads
5
Readme
云浏览器团队提交规范包
cloud-category-commit-rules是一个commitizen插件,提供了通过询问来组织git提交信息的功能
提交信息格式为:[novel][story][icafe-123][卡片名称]:[更改内容]
从左到右分别为:
- 业务名称,目前可以取值为novel或comic
- 需求类型,story或bug
- icafe卡片编号
- 需求卡片名称
- 更改内容
支持历史记录能力,在提交时会显示上一次的提交内容,按回车即可选择。
历史记录的记录规则为:以项目目录的位置和分支名称作为key,如果当前分支为新分支,则使用用户在该项目的上一次提交作为历史。
js项目安装
如果你的项目已经是一个js项目,包含package.json,那么可以这样安装: 首先安装包依赖:
npm i --save-dev commitizen cloud-category-commit-rules
然后编辑package.json,写入以下内容:
"scripts": {
"commit": "git-cz"
},
"config": {
"commitizen": {
"path": "cloud-category-commit-rules"
}
}
这样以后就可以直接通过npm run commit
来提交了
非js项目安装
非js项目也需要先安装nodejs,网络上有很多相关教程,可以跟着去安装 然后安装全局包依赖:
npm i -g commitizen cloud-category-commit-rules
然后在你的home目录,添加一段配置代码:
echo '{ "path": "cloud-category-commit-rules" }' > ~/.czrc
以后,就可以运行git cz来提交代码了