天天看点

项目的Commit 规范

文章目录

  • ​​一、前言​​
  • ​​二、type​​
  • ​​三、scope​​
  • ​​四、subject​​
  • ​​五、body​​
  • ​​六、footer​​
  • ​​七、示例​​

一、前言

根据 ​​angular 规范​​提交 commit,这样 history 看起来更加清晰,还可以自动生成 change log。

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>      

二、type

提交 commit 的类型,包括以下几种

feat: 新功能

fix: 修复问题

docs: 修改文档

style: 修改代码格式,不影响代码逻辑

refactor: 重构代码,理论上不影响现有功能

perf: 提升性能

test: 增加修改测试用例

chore: 修改工具相关(包括但不限于文档、代码生成等)

deps: 升级依赖

三、scope

修改文件的范围(包括但不限于 doc, middleware, proxy, core, config)

四、subject

用一句话清楚的描述这次提交做了什么

五、body

补充 subject,适当增加原因、目的等相关因素,也可不写。

六、footer

当有非兼容修改时可在这里描述清楚

关联相关 issue,如 Closes #1, Closes #2, #3

七、示例

fix($compile): couple of unit tests for IE9

Older IEs serialize html uppercased, but IE9 does not...

Would be better to expect case insensitive, unfortunately jasmine does

not allow to user regexps for throw expectations.

Document change on chair/doc!123

Closes #392

Breaks foo.bar api, foo.baz should be used instead