Lint Rego
rego_lintLint Rego policy source with Regal, receiving categorized violations (bugs, style, performance) including file and line locations. Supports inline source or filesystem paths with configurable rules and severity thresholds.
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 |
|---|---|---|---|
| source | No | Inline Rego source. Mutually exclusive with `paths`. | |
| paths | No | Filesystem paths to lint. Each path must be inside an allowed root (OPA_MCP_ALLOWED_PATHS). | |
| configFile | No | Path to a Regal config file (defaults to .regal/config.yaml lookup). | |
| disable | No | Disable specific named rules. | |
| enable | No | Enable specific named rules. | |
| disableCategory | No | Disable entire rule categories (e.g. style, idiomatic, bugs). | |
| enableCategory | No | Enable entire rule categories. | |
| failLevel | No | Severity at which Regal returns a non-zero exit. Default: `error`. | |
| ignoreFiles | No | Glob patterns to skip. |