commitlint
config file in the repo's root, as explained in Commitlint docs..pre-commit-config.yaml
:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: <latest tag>
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies
parameter of the hooks, here we use the @commitlint/config-angular
as an example:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: <latest tag>
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-angular']
commit-msg
hook in your project repo:
pre-commit install --hook-type commit-msg
Note that you need to specify a shared configuration in order for commitlint
to work, if commitlint
is new to you
just use their default configuration (@commitlint/config-conventional
). For more information, refer to their docs.
.pre-commit-config.yaml
:
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: <latest tag>
hooks:
- id: commitlint-travis
stages: [manual]
.travis.yml
:
script:
- pip install pre-commit
- pre-commit run --hook-stage manual commitlint-travis