-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
consider breaking lines before ) in multi-line calls #74
Comments
Sounds good. Let's make this rule a bit conservative for now, though; if we make all multi-line argument lists use a separate closing parentheses, we would rewrite
into one of
You could argue we want to do something like that in the long run, but it seems like less of a clear case. For example, we could only apply the rule to place |
I'd hope for at least the opening/closing newline behaviour of "Composite literals should use newlines consistently":
|
@icio the plan is to only change the code if the opening parentheses is at the end of a line, or if the closing parenthesis is at the start of a line. Those cases are pretty clearly inconsistent. What you suggest, which is what I mentioned in my last comment, would also trigger the rule if there are any newlines between arguments. I think that makes sense for composite literals, but I'm not convinced it always makes sense for calls. I'm still leaving that idea as a "maybe" for the future, but for now I want to add the more conservative rule that's a clear win. |
There is also https://github.com/segmentio/golines which does exactly one thing — splits long lines. It perfectly fits with gofumpt at the same time. |
gofumpt doesn't enforce any styles related to closing ) in multi-line calls:
It would be great if gofumpt would format these calls to the first option (or at least one of them, but I personally prefer the first one because it makes it clear that the next line should go on the same indentation level)
The text was updated successfully, but these errors were encountered: