docs/projects/regal/pre-commit-hooks.md
Pre-Commit is a framework for managing and maintaining multi-language pre-commit hooks. This allows running Regal automatically whenever (and as the name implied before) a Rego file is about to be committed.
To use Regal with pre-commit, add this to your .pre-commit-config.yaml
- repo: https://github.com/open-policy-agent/regal
rev: v0.7.0 # Use the ref you want to point at
hooks:
- id: regal-lint
# - id: ...
regal-lintRuns Regal against all staged .rego files, aborting the commit if any fail.
go build chain is installed and available on $PATHGOPATHregal-lint-use-pathRuns Regal against all staged .rego files, aborting the commit if any fail.
regal package is already installed and available on $PATH.regal-downloadRuns Regal against all staged .rego files, aborting the commit if any fail.
regal binary from Github.