-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Enable symmetrical braces for methods #3091
Conversation
e65ae73
to
424eccb
Compare
@@ -42,9 +42,7 @@ def on_or(node) | |||
receiver: receiver.source, | |||
method: method, | |||
combined_args: combine_args(first_call_args, second_call_args), | |||
original_code: node.source |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems there's a bug in the cop. When there's no element on the first line, the current indentation seems to me to be the preferable one.
Hopefully you understand my issue with current behaviour. For me:
is also symmetrical, as there's no element on the first line after |
@bbatsov I agree with you and I think that |
Well, as I said before - it depends for me on the line length. Normally I write method calls like this:
but when I'm short on space I go for:
Ideally there should be a style that's aware whether the first elem is on the same line as the opening paren and determine from it where the closing paren should be. |
424eccb
to
9c4c618
Compare
This cop does exactly that w/ the |
Apart from the failing build - the code looks good to me now. |
Related to rubocop#2914 this change enables `Style/MultilineMethodCallBraceLayout` and `Style/MultilineMethodDefinitionBraceLayout` with `EnforcedStyle: symmetrical` by default. All existing RuboCop code has been auto-corrected.
9c4c618
to
53cd262
Compare
Added one too many lines to one module. Fixed! |
👍 |
Related to rubocop#2914 this change enables `Style/MultilineMethodCallBraceLayout` and `Style/MultilineMethodDefinitionBraceLayout` with `EnforcedStyle: symmetrical` by default. All existing RuboCop code has been auto-corrected.
Related to #2914 this change enables
Style/MultilineMethodCallBraceLayout
andStyle/MultilineMethodDefinitionBraceLayout
withEnforcedStyle: symmetrical
by default.All existing RuboCop code has been auto-corrected.