Regal v0.13.0 released! #520
anderseknert
started this conversation in
Community
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This release brings 3 new linter rules, several performance improvements, and many fixes and tweaks to existing rules.
New rules:
use-if
anduse-contains
Category:
idiomatic
The
if
andcontains
keywords are considered idiomatic in modern Rego, as they help both with readability as well as to remove some ambiguities from earlier versions of the language. In fact, both of the keywords will be made mandatory in the upcoming OPA 1.0 release. There's no need to wait for that though! Theuse-if
anduse-contains
rules helps you get ahead of the curve and enforce the use of these keywords today.For more information, see the docs on use-if and use-contains.
Thanks @tsandall for suggesting these rules!
New rule:
if-empty-object
Category:
bugs
With the introduction of the
if
keyword, an empty pair of curly braces ({}
) is no longer considered a rule body, but an empty object. While previous versions of Rego would treat an empty body as an error,allow if {}
would be result in allow assigned totrue
, as an empty object is a "truthy" value. This is likely a mistake, and theif-empty-object
rule will help you find and fix it.For more information, see the docs on if-empty-object
Performance improvements
While Regal will scan most policy repositories in under a second, repos with thousands of policies are necessarily more demanding. This release brings many performance improvements, which should improve the experience working with Regal even for largest Rego repos. These improvements include:
file
attribute from AST nodes, resulting in less nodes to traverseOther improvements
compact
output format now prints a prettier compact tableBugs fixed
--config-file
is explictly provided but non-existent (thanks @mcguiresm!)See the full changelog and downloads here.
Beta Was this translation helpful? Give feedback.
All reactions