-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 fmt" makes policy with two "else" invalid #6157
Comments
Agreed! |
I'm interested in working on this bug, could you please point out which code files need to be modified? Thanks! |
Thanks for your interest @Ronnie-personal! The |
I'm thinking of making the following code changes. Am I heading in the right direction? 'func (p *Parser) parseElse(head *Head) *Rule {
}` |
This code successfully evaluated the following two policies. p if false p if false |
The best way to find out is submitting a PR with tests included :) |
Fixed in #6204. |
With this policy,
opa eval -fpretty -d bug.rego data.bug.p
gives2
:When running
opa fmt -w
on it, it is transformed toThis file, however, OPA fails to evaluate:
Two solutions come to mind:
else
bodieselse
bodiesI think we should go with (2.). It's hard to explain why the short form isn't valid for
else
bodies in the first place.The text was updated successfully, but these errors were encountered: