-
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 build
panics on second end-of-line comment in function call
#3836
Labels
Comments
FWIW this one and #3832 are related to formatting (pretty-printing) policies. This happens as one of the steps in using |
So what's happening here is that it attempts to make it a one-line statement: rule1 = contains("", "") # first comment and doesn't know what to do with the second comment. |
srenatus
added a commit
to srenatus/opa
that referenced
this issue
Oct 6, 2021
This snippet, r = contains( input.x, "y", ) would have been formatted as r = contains(input.x, "y") before. Now, any new lines added between function arguments will be kept, and the snippet will not be reformatted. As a consequence, comments on the separate arguments we OK: r = contains( input.x, # haystack "y", # needle ) and don't freak out the formatter. Fixes open-policy-agent#3836. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus
added a commit
that referenced
this issue
Oct 6, 2021
This snippet, r = contains( input.x, "y", ) would have been formatted as r = contains(input.x, "y") before. Now, any new lines added between function arguments will be kept, and the snippet will not be reformatted. As a consequence, comments on the separate arguments we OK: r = contains( input.x, # haystack "y", # needle ) and don't freak out the formatter. Fixes #3836. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
dolevf
pushed a commit
to dolevf/opa
that referenced
this issue
Nov 4, 2021
…nt#3864) This snippet, r = contains( input.x, "y", ) would have been formatted as r = contains(input.x, "y") before. Now, any new lines added between function arguments will be kept, and the snippet will not be reformatted. As a consequence, comments on the separate arguments we OK: r = contains( input.x, # haystack "y", # needle ) and don't freak out the formatter. Fixes open-policy-agent#3836. Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com> Signed-off-by: Dolev Farhi <farhi.dolev@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
The following rego code should compile, run and
opa build
.testcase.rego
:Actual Behavior
opa build
panics:However, the code compiles and runs:
Steps to Reproduce the Problem
Save
testcase.rego
to disk and run the commands shown above.Additional Info
The text was updated successfully, but these errors were encountered: