-
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
Format of multiple union sets #2958
Comments
Formatting is obviously subjective in nature, and how it should work with indentation multi-line assignment is an interesting question. One thing I very much agree on is that the formatter should be able to take line length into account. I've had a few cases where |
@anderseknert I agree with you, it's totally subjective. I am open to having a different style, mine was just a suggestion that works for me. Sorry for not making that clearer in my original message. The main issue for me is that using multiple parentheses to separate the unions into "couples" and not taking into account the final line length makes the code quite hard to read and maintain. Another suggestion, could be:
Anyway, just some suggestions. :) |
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. |
This issue has been automatically marked as inactive because it has not had any activity in the last 30 days. |
Closing in favor of #4508, where we'll try to compile all ideas for the next iteration of |
Expected Behavior
I expect the format command to leave the below statement unchanged or a way to tell
opa fmt
to ignore it.Actual Behavior
The line gets changed to this, highly impacting the readability and maintainability of the code.
Steps to Reproduce the Problem
Create a file called
policy.rego
with the following content:Then you can run:
$ opa fmt policy.rego -w
OPA version
0.24.0
Additional Info
All the variables there are sets, their actual values are irrelevant to the issue being reported.
The text was updated successfully, but these errors were encountered: