mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
5951e5dee8
This will show the project under /projects/, where some other upcoming additions will have their docs too. Signed-off-by: Charlie Egan <charlieegan3@users.noreply.github.com> Co-authored-by: Charlie Egan <charlieegan3@users.noreply.github.com>
1.4 KiB
1.4 KiB
sidebar_position
| sidebar_position |
|---|
| 6 |
Pre-Commit Hooks
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: ...
Hooks Available
regal-lint
Runs Regal against all staged .rego files, aborting the commit if any fail.
- requires the
gobuild chain is installed and available on$PATH - will build and install the tagged version of Regal in an isolated
GOPATH - ensures compatibility between versions
regal-lint-use-path
Runs Regal against all staged .rego files, aborting the commit if any fail.
- requires the
regalpackage is already installed and available on$PATH.
regal-download
Runs Regal against all staged .rego files, aborting the commit if any fail.
- Downloads the latest
regalbinary from Github.