aaronjameslang / proofr
Git钩子,用于检查符合http://chris.beams.io/posts/git-commit/
2.2.0
2017-04-09 16:54 UTC
This package is not auto-updated.
Last update: 2024-09-29 03:15:25 UTC
README
Git钩子,用于检查符合http://chris.beams.io/posts/git-commit/
您或您的合作伙伴是否难以记住如何格式化提交消息?试试proofr
。
proofr
无缝集成到您的日常工作中
- 如果您编写了符合规范的提交消息,您甚至不知道它的存在
- 如果您编写了不符合规范的提交消息,提交将会失败,并且您将收到反馈
$: git commit --allow-empty --message 'fixed it.' Capitalize the subject line Do not end the subject line with a period Use the imperative mood in the subject line $:
优秀的git提交消息的七条规则
- 使用空行将主题和正文分开
- 将主题行限制在50个字符以内
- 大写主题行
- 主题行末尾不要加句号
- 在主题行中使用祈使句
- 将正文包装在72个字符以内
- 使用正文来解释什么和为什么,而不是如何
安装
Homebrew/Linuxbrew
brew install
aaronjameslang/tap/proofr
Composer/Packagist
composer [global] require
aaronjameslang/proofr
设置
cd my-project && proofr setup
这会将proofr
添加到您项目的commit-msg
钩子中
proofr
的工作原理
在您编写每个提交消息后,git将调用.git/hooks/commit-msg
并将提交消息作为第一个参数传递。您可以将commit-msg
设置为任何您喜欢的名称,只要它
- 调用
proofr
- 将第一个参数传递给
proofr
- 处理
proofr
的退出代码 - 是可执行的
有关背景信息,请参阅http://githooks.com
兼容性
应在大多数*nix上正常工作,包括GNU/Linux、Mac OSX和Windows Subsystem for Linux
如果您不确定系统兼容性,请运行make
。如果您的系统不兼容,请创建一个问题。
贡献
建议、错误报告和pull请求都欢迎。请在开始pull请求之前打开一个问题并获取反馈。
设计决策
- 测试最初是用
roundup
编写的,但是为了使用户更容易在自己的机器上运行测试,删除了这个依赖项。