regal icon indicating copy to clipboard operation
regal copied to clipboard

Regal is a linter for Rego, with the goal of making your Rego magnificent!

Results 63 regal issues
Sort by recently updated
recently updated
newest added

A few rules need to know which variables (and rules from the package) are in scope at a given location. This is needed for example when something like `input[x]` is...

design

This is an improvement that will be incorporated in OPA [soon](https://github.com/open-policy-agent/opa/issues/6109). However, the check in OPA will be at runtime and not be done by e.g. `opa eval`. For that...

rule

While we obviously can't do this with values assigned from `input` or `data`, it is sometimes useful to be able to track the value of a var in scope of...

enhancement

Will the below policy work or not? ```rego package play f(arr) := upper(arr[_]) x := f(input.arr) ``` The answer depends on the number of elements in `input.arr`. 1 item is...

rule
category/bugs

Gatekeeper Rego is embedded in custom resource definitions, i.e. YAML files. While there are tools to allow authoring "normal" .rego files and then have them inserted in CRDs, I suppose...

enhancement
design

When run in a directory containing a `.regal` sub-dir, we could create a `.regal/cache` storing the checksums of each file linted in the past in order to not have to...

performance

```rego allow { 1 == 1 true false } ``` And so on... Note that we can't do much about a single `true` in an otherwise empty body, as: ```rego...

rule
category/bugs

This is tricky to do this check, but rego that checks if `sprintf("%d), [x])` contains `%!` is an implementation detail you don't want in your policies. It depends on the...

For the purpose of getting started, our rules currently leverage a (perhaps too) simple model of the input, where each linter rule iterate over rules, expressions and terms looking for...

design

As a user, I would like to be warned when I use the `=` operator in a policy and be reminded that `:=` and `==` are explicit and clear, whereas...