-
-
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
EndAlignment method chaining #346
Comments
@jonas054 I guess you should tackle this one as well. |
I'd actually like to pass the ball to @edzhelyov. The above code is a good example of the "start of the line where BTW, even the mighty Emacs has trouble indenting the above code, and the result is less logical than how @SirLenz0rlot did it. It does pass rubocop's inspection though. Here it is: def foo(bar)
bar.get_stuffs
.select {|stuff| stuff.present?}
.select {|stuff| stuff.attribute == 'whatever'}
.reject do |stuff|
stuff.with_a_very_long_expression_that_doesnt_fit_the_line
end.select do |stuff|
stuff.another_very_long_expression_that_doesnt_fit_the_line
end
.select do |stuff|
stuff.another_very_long_expression_that_doesnt_fit_the_line
end
end Again, this is by no means better. I just wanted to show it as an example of how complex the problem is. |
Fixes rubocop#393 by removing the solution for rubocop#346.
The solution for this issue has been removed because we don't want to encourage multiline chaining of blocks. The Ruby Style Guide says that multiline chaining is ugly. |
I have some interesting code, that doesnt pass the EndAligntment checks (rubocop fails on the do..end blocks):
I've tried (as the example shows) both putting the .select on the same line and on the next line.
The text was updated successfully, but these errors were encountered: