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

Opa doesn't support var keyword on rego files. #179

Open
marcoslopesbritto opened this issue Mar 10, 2020 · 2 comments
Open

Opa doesn't support var keyword on rego files. #179

marcoslopesbritto opened this issue Mar 10, 2020 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@marcoslopesbritto
Copy link

Fregot, has a var (keyword) to declare variables, but when use this keyword on opa check, it show us this error message:
rego_parse_error: var cannot be used for rule name.

@marcoslopesbritto marcoslopesbritto changed the title Fugue Rego ToolKit Opa doesn't support var keyword on rego files. Mar 10, 2020
@jaspervdj-luminal jaspervdj-luminal self-assigned this Mar 11, 2020
@jaspervdj-luminal jaspervdj-luminal added the bug Something isn't working label Mar 11, 2020
@jaspervdj-luminal
Copy link
Member

Thanks for reporting! Looks like var (and possibly others, I'll check) need to be added to a list of reserved keywords. We should be able to get a fix for this pretty soon.

@jaspervdj-luminal
Copy link
Member

@marcoslopesbritto I'm having trouble reproducing this issue. Is there any chance you could share the code you were using, or the relevant portions? Knowing which versions of OPA and Fregot this applies to would also be useful.

If I have a Rego file that declares a var rule:

# test.rego
package play
var {
  true
}

opa check test.rego reports no errors, and fregot repl test.rego loads the file fine.

This is using opa master (834aaee4c2b74a738183da736f1acf8314799888) and fregot v0.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants