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

![Screenshot 2024-01-18 at 14 17 08](https://github.com/StyraInc/regal/assets/510711/99f39b52-0969-4509-b5f3-00622a9d27ba) A new user browsing to the docs for a rule will not know where to put this configuration (`.regal/config.yaml`). So it would be good...

documentation
good first issue

```rego foo { some x input[x] } ``` Even in strict mode, OPA considers `x` to be "used", as it's referenced _somewhere_. Howver, unless `x` is referenced later in the...

rule
category/idiomatic

We have a number of repos using Regal to lint policy. It'd be nice to be able to run a main build of Regal against these repos nightly. Current list:...

Hello Let's say we have file test.rego with following content, ```rego package test default allow := true ``` Running `regal` with JSON format `regal lint --format json test.rego` - the...

bug
tooling

If a module has more than one reference to the same `data` document, and there is no corresponding import, the largest common path should be suggested as a new import....

rule
category/imports

If a rule uses the underscore convention for "private" rules (i.e. `_foo := "bar"`) , we should warn if that's not used within the same policy, or imported / referenced...

rule

**Avoid** ```rego input.number = 5 ``` **Prefer** ```rego input.number == 5 ``` Motivation: while there are a few valid cases for unification, the unification operator (`=`) should not be used...

rule
category/style

Few policies seem to make use of the new [strings.any_prefix_match](https://www.openpolicyagent.org/docs/latest/policy-reference/#builtin-strings-stringsany_prefix_match) and [strings.any_suffix_match](https://www.openpolicyagent.org/docs/latest/policy-reference/#builtin-strings-stringsany_suffix_match) functions. These functions are extremely performant even when dealing with huge datasets. They have a benefit on smaller...

rule
category/idiomatic

We currently provide an intro to using the GitHub Action here: https://github.com/StyraInc/regal#github-actions I think it would be good to break that out into a separate page on the topic of...

documentation

It would be a good addition to have a rule that warns on use of boolean rules that are missing a default condition. Obviously this isn't wrong per se, so...

rule
category/custom
aggregate