Lint Rego
rego_lintLint Rego policies for bugs, style, idioms, and performance issues. Returns categorized violations with file/line locations, supporting filesystem paths or inline source.
Instructions
Lint Rego source with the Regal linter. Returns categorized violations (style, bugs, idiomatic, performance) with file/line locations. Requires regal on PATH or REGAL_BINARY set; returns REGAL_NOT_FOUND otherwise. When called with inline source, location-bound rules whose verdict depends on the on-disk path (directory-package-mismatch) are auto-disabled to avoid temp-file false positives, and location.file is reported as <inline> instead of the randomized temp path. Re-enable those rules via enable if your workflow actually needs them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| paths | No | Filesystem paths to lint. Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). | |
| enable | No | Enable specific named rules. | |
| source | No | Inline Rego source. Mutually exclusive with `paths`. | |
| disable | No | Disable specific named rules. | |
| failLevel | No | Severity at which Regal returns a non-zero exit. Default: `error`. | |
| configFile | No | Path to a Regal config file (defaults to .regal/config.yaml lookup). | |
| ignoreFiles | No | Glob patterns to skip. | |
| enableCategory | No | Enable entire rule categories. | |
| disableCategory | No | Disable entire rule categories (e.g. style, idiomatic, bugs). |