CLI to check about that commit message is based on "conventional commits". (include pre-commit
hooks)
Conventional Commits is specification for commit messages.
This repository is python package to provide CLI command and pre-commit
hooks definitions
to check that your commit messages are based on spec of "conventional commits".
Install from GitHub
$ pip install git+https://github.com/attakei/check-conventional-commits
When using CLI, you can pass message by STDIN or file.
$ echo "feat: Implement new func" | check-conventional-commits
(If it is valid, no output and exit 0)
$ echo "Fix it" | check-conventional-commits
(If is is invalid, output message and exit 1)
If you want to append other types, use --extra-types
$ echo "test: Implement new func" | check-conventional-commits
(invalid)
$ echo "test: Implement new func" | check-conventional-commits --extra-types=test
(valid!)
This repository includes definition of pre-commit
hooks.
You can run it simply in your repository.
repos:
- repo: https://github.com/attakei/check-conventional-commits
rev: v0.0.3
hooks:
- id: check-conventional-commits
Note
This hook run on "commit-msg" stage.
You shoud set commit-msg hooks by pre-commit install -t commit-msg
(TBD)