Set up conventional-pre-commit as a pre-commit hook
mainTo use conventional-pre-commit to automatically validate your commit messages during the git commit process, follow these steps:
- Ensure
pre-commitis installed on your system. - Create a
.pre-commit-config.yamlfile at your repository root if it doesn't exist. - Configure the
default_install_hook_typesto includecommit-msg. - Add the
conventional-pre-commitrepository to yourreposlist. - Install the hooks using
pre-commit install --install-hooks.
Note: When used as a hook, the input file argument is automatically supplied by pre-commit using the current commit's message file.
default_install_hook_types:
- pre-commit
- commit-msg
repos:
- repo: https://github.com/compilerla/conventional-pre-commit
rev: <git sha or tag>
hooks:
- id: conventional-pre-commit
stages: [commit-msg]
args: []