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
example.rb:1:1: W: Lint/RequireParentheses: Use parentheses in the method call to avoid confusion about precedence.
self.foo = bar && baz ? 'qux' : 'quux'
^^^^^^^^^^^^^^^^^^^^^
Correcting back-and-forth just keeps you in this loop forever.
Interesting wildcard: the first offense happens when the sample code is self.foo =, but not when it's foo =, which makes me think the first offense is a bug.
Expected behavior
Based on the docs for Lint/RequireParentheses, it seems like it's only supposed to apply when predicate methods are used, which isn't happening in the sample code, so it probably shouldn't apply here.
Sample code:
Running Rubocop against that, you get:
However, correcting it to:
Rubocop now reports:
Correcting back-and-forth just keeps you in this loop forever.
Interesting wildcard: the first offense happens when the sample code is
self.foo =
, but not when it'sfoo =
, which makes me think the first offense is a bug.Expected behavior
Based on the docs for
Lint/RequireParentheses
, it seems like it's only supposed to apply when predicate methods are used, which isn't happening in the sample code, so it probably shouldn't apply here.Actual behavior
See above.
Steps to reproduce the problem
See above.
RuboCop version
The text was updated successfully, but these errors were encountered: