-
-
Notifications
You must be signed in to change notification settings - Fork 58
Block arguments in if
statements uses {
, triggering Rubocop
#122
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
Comments
I'm pretty sure the fix here is to check for |
For someone who faces this issue and don't want to use |
I'm also running into Original: def example
return if array_of_things.any? do |complicated_thing|
complicated_thing == another_thing
end
do_stuff
end Formatted: def example
if array_of_things.any? { |complicated_thing|
complicated_thing == another_thing
}
return
end
do_stuff
end I'm not 100% sure the formatting isn't correct; something like the below formatting isn't great either. def example
if array_of_things.any? do |complicated_thing|
complicated_thing == another_thing
end
return
end
do_stuff
end |
Sample code after formatting using
@prettier/plugin-ruby
3:This is triggering Rubocop, even after including this gem's config:
The original code (formatted by the Prettier plugin v2) cas using
do … end
, which did not trigger Rubocop.I am not sure what is the correct fix here:
do … end
again (but this might not be safe if I understand Transform between braces & do/end when reflowing blocks? #120 correctly)The text was updated successfully, but these errors were encountered: