<type>: 描述
用於說明 commit 的類別,只容許使用下面標識:git
feat
:新功能(feature)fix
:修補bugdocs
:文檔(documentation)style
: 格式(不影響代碼運行的變更)refactor
:重構(即不是新增功能,也不是修改bug的代碼變更)perf
:優化npm install --save-dev validate-commit-msg
而後,添加文件.vcmrcnpm
{ "types": ["feat", "fix", "docs", "style", "refactor", "perf"], "scope": { "required": false, "allowed": ["*"], "validate": false, "multiple": false }, "warnOnFail": false, "maxSubjectLength": 100, "subjectPattern": ".+", "subjectPatternErrorMsg": "subject does not match subject pattern!", "helpMessage": "", "autoFix": false }
npm install ghooks --save-dev
https://www.npmjs.com/package/ghooks
Add a config.ghooks entry in your package.json,配置暫時只須要:json
{ … "config": { "ghooks": { "commit-msg": "validate-commit-msg" … } } … }