Lint Rego
rego_lintLint Rego source files using Regal to detect and categorize violations in style, bugs, idiomatic, and performance rules, with file and line locations.
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 rather than paths, expect location-bound rules such as directory-package-mismatch to fire as artifacts of the randomized temp-file path. Prefer paths for canonical signal; for inline workflows, ignore or disable those rules.
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. |