Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle "pure" v1 files and projects/workspaces #651

Open
johanfylling opened this issue Apr 11, 2024 · 1 comment
Open

Handle "pure" v1 files and projects/workspaces #651

johanfylling opened this issue Apr 11, 2024 · 1 comment

Comments

@johanfylling
Copy link
Member

When using the --v1-compatible flag with OPA, it'll behave exactly as v1.0 OPA. Meaning a Rego file isn't required to use the rego.v1 and future.keywords imports; e.g.:

package demo

p contains "Hello" if {
    input.x == 2
}

It'd be nice if Regal could be somehow instructed to deal with such files without errors or warnings.

One possible, non-obtrusive solution that would work with at least a subset of Rego projects would be to pick up the .manifest file in the workspace, and read the rego_version and file_rego_versions attributes (will be available in OPA v0.64.0).

@anderseknert
Copy link
Member

Adding a --v1-compatible flag to regal lint seems easy enough, so let's do that. Looking for a .manifest file and use that seems like a good idea too if that's what OPA will be doing, and we can probably borrow some logic around that from OPA directly.

A PR would be welcome ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: TODO
Development

No branches or pull requests

2 participants