Regal v0.22.0 released! #589
anderseknert
started this conversation in
Ecosystem
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a release brings 3 new linter rules, as well as some exciting new features, improvements and fixes to both the linter and the language server.
New rule:
impossible-not
Category:
bugs
The
impossible-not
rule will flag when thenot
keyword is used to test a partial (multi-value) rule. Even when a set contains no values, it isn't considered "falsey", so usingnot
in that context is essentially a constant condition. This mistake is particularly common in tests:Future versions of this rule may detect even more impossible
not
conditions.For more information, see the docs on impossible-not.
New rule:
messy-rule
Category:
style
Rules that are defined incrementally should be be placed in a sequence, and with no other rule definitions in between. The new
messy-rule
linter will help identify such cases, and suggest a re-organization.Avoid
Prefer
For more information, see the docs on messy-rule.
New rule:
trailing-default-rule
Category:
style
The new
trailing-default-rule
linter will flag rules with defaultdefault
conditions where thedefault
assignment isn't placed before the other rules. Putting thedefault
rule first makes it easier to read the policy, knowing there's a default fallback condition for the rules requiring more complex conditions to be met.Avoid
Prefer
For more information, see the docs on trailing-default-rule.
Language server: Code completion suggestions
The Regal language server now provides a minimal implementation of the code completion feature. This first implementation will help suggest package name based on directory structure, the
rego.v1
import and built-in functions at certain locations. This provides a big productivity boost, as users no longer need to jump back to the OPA docs to find the built-in function they need.More completion suggestions will follow in the next releases, like references to rules and functions. Stay tuned!
Other improvements
regal new rule
command now also creates an empty documentation template for the ruleregal fix
command now provides documentation for which rules it can fixBugs fixed
regal lint --profile
would report wrong metricsnull
instead of empty object, as per the specification.regal/config.yaml
filewith
keyword is used (thanks @asleire for reporting this issue!)See the full changelog, and get your copy here. Happy linting!
Beta Was this translation helpful? Give feedback.
All reactions