包详细信息

git-commit-message-checker

hongyuanlei28Unlicense1.0.1

GIT COMMIT-MSG hook for validating commit message.

git, message validation

自述文件

git-commit-message-checker

git-commit-message-checker is a tools for checking whether your commit message is valid or not. If not, your commit will fail.

Installation

npm install --save-dev git-commit-message-checker

How to use

git-commit-message-checker need to be used with Husky. Add this config to package.json

  "scripts": {
     "commitmsg": "check-git-commit-msg --max-length=150 --pattern=\"/^\[[\w-]*\]\s\w*(\s&\s\w*)?\s?:.*/\"",
     ....
  }

--pattern

The default commit message pattern is:

/^\[[\w-]*\]\s\w*(\s&\s\w*)?\s?:.*/

It can allow the commit message like this:

  • [CardNumber] author: commit purpose
  • [CardNumber] author1 & author2: commit purpose

--max-length

The default commit message max-length is 150, you can change it in the command line

更新日志

v2.0.1 (2017-07-30)

v2.0.0 (2017-07-13)

v1.0.0 (2017-07-13)

v1.0.0 (2017-07-13)