An open API service indexing awesome lists of open source software.

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

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"

```