This repo defines Git pre-commit hooks intended for use with pre-commit. The currently supported hooks are:
- asterisklint - check syntax of Asterisk PBX configuration files
In each of your repos, add a file called .pre-commit-config.yaml with the following contents:
repos:
- repo: https://github.com/VCTLabs/asterisklint-hooks
rev: v0.4.3 # Get the latest from: https://github.com/VCTLabs/asterisklint-hooks/tags
hooks:
- id: dialplan-check
Next, have each developer:
- Install pre-commit, e.g.
apt|brew install pre-commit
- Run pre-commit install in the repo
That’s it! Now every time you commit a code change (extensions.conf
files),
the hooks in the hooks:
config will execute.
Example linting all files
If you'd like to lint all of your files at once (rather than only the changed files), you can run:
$ pre-commit run dialplan-check --all-files
This code is released under the MIT License. Please see the LICENSE file for more details.