Skip to content

VCTLabs/asterisklint-hooks

Repository files navigation

Pre-commit hooks

Mirror Status CI Status Coverage Status Pylint Status

Maintained by VCTLabs Test coverage Pylint score

GitHub tag License Python

This repo defines Git pre-commit hooks intended for use with pre-commit. The currently supported hooks are:

General Usage

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.

Running Against All Files At Once

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

License

This code is released under the MIT License. Please see the LICENSE file for more details.