synchot/传统提交

php的传统提交

v5.0.5 2020-01-24 14:54 UTC

README

此包将使用 .git/hooks/commit-msg 来检查 git commit -m "您的消息" 是否符合传统提交规范。

安装

添加到 composer.json

"scripts": {
    "post-install-cmd": [
      "SyncHot\\ConventionalCommit\\Services\\ComposerBuild::copyHooks"
    ],
    "post-update-cmd": [
      "SyncHot\\ConventionalCommit\\Services\\ComposerBuild::copyHooks"
    ]
  }

运行

composer require --dev synchot/conventionalcommit

如何运行

在Windows机器上,请选择git-bash作为默认控制台。

git commit -m "Some message"

发生错误

在您的项目中

cat .git/hooks/commit-msg

如果其值与 vendor/synchot/conventionalcommit/resources/commit-msg 中的值相同,那么您就可以继续了,否则尝试复制此值。

用户自定义配置

创建 /config/packages/conventionalcommit.yaml

内容为

/vendor/synchot/conventionalcommit/config/conventionalcommit.yaml

修改所有值以满足您项目的需求。

移除此插件

cd <your project dir>
cd .git/hooks
rm commit-msg

变更日志

https://bitbucket.org/SyncHot/conventionalcommit/src/master/CHANGELOG.md

待办事项

  • 重构
  • 编写测试

许可协议

MIT Jędra Marcin