Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhike-team/commit-message-validator
Git commit-msg hook validator
https://github.com/zhike-team/commit-message-validator
Last synced: 2 months ago
JSON representation
Git commit-msg hook validator
- Host: GitHub
- URL: https://github.com/zhike-team/commit-message-validator
- Owner: zhike-team
- License: mit
- Created: 2017-04-28T08:09:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-02-12T02:21:28.000Z (almost 3 years ago)
- Last Synced: 2024-04-16T14:16:50.365Z (10 months ago)
- Language: JavaScript
- Size: 74.2 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# commit-message-validator
Git commit-msg validatorThis package provides you a binary that you can use as a git hook to validate the commit message.
This package can be used with githook packages such as [husky](https://www.npmjs.com/package/husky).
If you are using **husky**, add `"commitmsg": "commit-message-validator"` to your npm scripts in package.json.
# Installation
This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:
npm install commit-message-validator
# Usage
1. Install this package as one of your project's devDependencies
2. Install githook [husky](https://www.npmjs.com/package/husky)
3. Config commit-msg hook to run commit-message-validator in package.json{
"husky": {
"hooks": {
"commit-msg": "commit-message-validator"
}
}
}
4. Custom commit-message regex pattern in package.json{
"config": {
"commit-message-validator": {
"_comment": "pattern can be Regex string or array of Regex string",
"pattern": "your regex pattern here",
"errorMessage": "your error message"
}
}
}