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
Cop Style/IfUnlessModifier doesn't add parentheses when correcting an if-end condition inside a method argument list leading to a SyntaxError. I'm going to provide a PR.
Steps to reproduce the problem
Suppose we have the test.rb file with the following code:
puts('string', if 2
1
end)
Run rubocop test.rb --only Style/IfUnlessModifier -a.
Cop
Style/IfUnlessModifier
doesn't add parentheses when correcting an if-end condition inside a method argument list leading to a SyntaxError. I'm going to provide a PR.Steps to reproduce the problem
Suppose we have the
test.rb
file with the following code:Run
rubocop test.rb --only Style/IfUnlessModifier -a
.Expected behavior
Actual behavior
RuboCop version
0.89.0 (using Parser 2.7.1.4, rubocop-ast 0.2.0, running on ruby 2.5.1 x86_64-darwin18)
The text was updated successfully, but these errors were encountered: