Style/SoleNestedConditional
incorrectly corrects when assignment in conditional
#10285
Labels
Style/SoleNestedConditional
incorrectly corrects when assignment in conditional
#10285
When there's an assignment in a conditional (don't judge me! it's an old codebase!),
rubocop -a
creates an invalid autocorrectionExpected behavior
either the autocorrector is marked unsafe or the assignment is wrapped in parens, e.g.
Actual behavior
this autocorrection incorrectly changes the value of
a
from its original4
tofalse
Steps to reproduce the problem
rubocop -a
over the example at the top of the fileRuboCop version
The text was updated successfully, but these errors were encountered: