Regal v0.16.0 released! #550
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 adds 2 new linter rules and a language server protocol (LSP) implementation to Regal.
New rule:
duplicate-rule
Category:
bugs
The new
duplicate-rule
linter rule flags any rules with duplicated code found in a policy. Duplicate rules are almost certainly a mistake, perhaps from copy-pasting code, and should simply be fixed (or likely, removed).For more information, see the docs on duplicate-rule.
New rule:
use-rego-v1
Category:
imports
OPA v0.59.0 introduced a new import named
rego.v1
. Whenimport rego.v1
is used in a policy, OPA will ensure the policy is compliant with the upcoming OPA 1.0 release. This include enforcing the use of theif
andcontains
keywords, that no deprecated built-ins are used, and more. To learn more about OPA 1.0 and therego.v1
import, see the OPA docs.As
rego.v1
replaces thefuture.keywords
imports, the Regal rules around those imports are automatically disabled whenuse-rego-v1
is in use. If you wish to target a version of OPA beforerego.v1
, use the capabilities feature of the Regal configuration file.Avoid
Prefer
For more information, see the docs on use-rego-v1.
New feature: Regal language server
The Language Server Protocol (LSP) provides a way for editors to integrate support for various programming languages using a common protocol. Using an LSP server implementation rather than one built specifically for a single editor allows the same code to be used across all editors with LSP support. v0.16.0 brings a language server mode to Regal, allowing diagnostics (i.e. linting) of Rego to be performed continuously in a workspace rather than as a one-off CLI operation. This is the first step towards bringing Regal into editors like VS Code, and having linting of Rego natively supported as you work with your policies. Expect to see more in this space soon!
Huge thanks to @charlieegan3 for this outstanding contribution!
See the full changelog, and downloads, here.
Beta Was this translation helpful? Give feedback.
All reactions