You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow up rubocop/rubocop#12227 (comment)
This PR adds new "Single-line `do`...`end` block" rule.
Use multi-line `do`...`end` block instead of single-line `do`...`end` block.
```ruby
# bad
foo do |arg| bar(arg) end
# good
foo do |arg|
bar(arg)
end
# bad
->(arg) do bar(arg) end
# good
->(arg) { bar(arg) }
```
Some will argue that multi-line chaining would look OK with the use of {...}, but they should ask themselves - is this code really readable and can the blocks' contents be extracted into nifty methods?
0 commit comments