Regal v0.33.0 released! #690
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 release adds 4 new linter rules to Regal, alongside significant performance improvements and several bug fixes.
New Rule:
in-wildcard-key
Using a wildcard variable (
_
) for the key in the key-value form of iteration (some _, value in collection
) is never needed, and can be replaced by the simplesome value in …
form . This rule flags cases where the key iteration is redundant. (Read more)New Rule:
confusing-alias
While import aliases can improve readability, aliasing an import reference that is also imported without an alias is confusing, as both names point to the same resource. This rule catches such cases. (Read more)
New Rule:
mixed-iteration
Rego supports different styles of collection iteration. While "reference style" iteration (
collection[_]
) can be concise for deeply nested structures, mixing it with thesome .. in
style within a single iteration expression makes for code that’s more difficult to follow. This rule encourages consistency within a single iteration statement. (Read more)New Rule:
narrow-argument
This new rule analyzes function arguments to suggest narrowing them down to the minimal value the function depends on. This can improve clarity and reusability. The rule considers incrementally defined functions across all their definitions. This is a powerful but opinionated rule and is thus in the custom category and is not on by default. See the documentation for how to enable it if you’re curious to try it out! (Read more)
Performance Improvements
Several improvements have been made to reduce memory allocations and improve overall linting performance. Numbers below refer to Regal’s benchmark for linting its own policies.
use-strings-count
rule, saving almost 1 million allocations (#1465).external-reference
rule to make it more configurable (#1496).OPA v1.3.0
Regal has been upgraded to use OPA v1.3.0. This brings several upstream improvements, including support for the new one-liner grouping in formatting (see OPA#6760). (#1459)
Bug Fixes
FindConfigRoots
when supplied with unexpected arguments. (#1487)Other Rule Updates
external-reference
rule can now be configured with a maximum number of allowed external references, instead of solely flagging all external uses within a function. If you previously had this rule disabled, you might want to try enabling it now, and possibly tweak its configuration to your liking. (#1496)rule-length
rule now has a separate setting (max-test-rule-length
) with a higher default value (60 vs 30) for test rules, acknowledging that tests often include substantial data. (#1476)rule-named-if
rule based on community feedback received via the page feedback form (please let us know if you see issues! & thanks for the report!) (#1463)Full changelog, and downloads, here.
Beta Was this translation helpful? Give feedback.
All reactions