https://github.com/rrxs/git-policy-validator
Node CLI to validate commit messages and branch names
https://github.com/rrxs/git-policy-validator
branch-naming cli commit-msg git git-hooks husky javascript node pre-push regex typescript validate validation
Last synced: 9 months ago
JSON representation
Node CLI to validate commit messages and branch names
- Host: GitHub
- URL: https://github.com/rrxs/git-policy-validator
- Owner: rrxs
- License: mit
- Created: 2024-04-01T20:23:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-02T12:44:01.000Z (over 1 year ago)
- Last Synced: 2025-03-02T06:04:34.580Z (10 months ago)
- Topics: branch-naming, cli, commit-msg, git, git-hooks, husky, javascript, node, pre-push, regex, typescript, validate, validation
- Language: TypeScript
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-policy-validator
```bash
🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧
UNDER CONSTRUCTION
🚧 🚧 🚧 🚧 🚧 🚧 🚧 🚧
```
## Description
A simple CLI that can be used to validate branch and commit messages using a regex configuration.
Examples of use:
```bash
# Validate commit message
gvalidate -c "Add new feature"
# Validate branch name
gvalidate -b
```
### Configuration
You must use a config file named `.gvalidate.config.json`. Example config file.
```json
{
"branch": {
"regexBranchName": "(feat|fix)/[A-Z]+-[0-9]+",
"ignoreList": []
},
"commit": {
"regexCommitMessage": "(feat|fix): [A-Z]+-[0-9]+ - .*"
}
}
```
## Todo
- Unit tests
- Custom error messages
- [...]
## Development
To run locally run the following commands.
```bash
# After cloning
npm i
npm run build:dev
npx gvalidate -c "feat: Teste message"
```