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
Style/RedundantParentheses detected and autocorrect will remove parens.
pin.rb:5:16: C: [Correctable] Style/RedundantParentheses: Don't use parentheses around a method call.
foo in { bar: ^(var.to_i) }
^^^^^^^^^^
pin.rb:6:16: C: [Correctable] Style/RedundantParentheses: Don't use parentheses around a method call.
foo in { bar: ^(meth) }
^^^^^^
…rentheses`
Fixesrubocop#10979.
This PR fixes a false positive for `Style/Style/RedundantParentheses`
when using parentheses in method call with pin operator.
…rentheses`
Fixesrubocop#10979.
This PR fixes a false positive for `Style/RedundantParentheses` when using parentheses with pin operator except for variables.
Ruby 3.1+ allows expression in pattern match (pin operator).
cf. https://bugs.ruby-lang.org/issues/17411 https://bugs.ruby-lang.org/issues/17724
Expected behavior
No offences shoud be detected:
Actual behavior
Style/RedundantParentheses
detected and autocorrect will remove parens.Steps to reproduce the problem
See above.
RuboCop version
The text was updated successfully, but these errors were encountered: