Auto-correcting with Style/IfUnlessModifier
and Style/SoleNestedConditional
breaks code
#10016
Labels
Style/IfUnlessModifier
and Style/SoleNestedConditional
breaks code
#10016
Style/IfUnlessModifier
andStyle/SoleNestedConditional
produce incorrect code when auto-correcting the following code:The following similar bits of code do not have the same problem:
Expected behavior
rubocop --auto-correct
should produce the following code:Actual behavior
Rubocop produces the following incorrect code. The code now throws an error if error_list is nil.
Steps to reproduce the problem
Run
rubocop --auto-correct --debug code.rb
on the following code.Output on my machine:
RuboCop version
The text was updated successfully, but these errors were encountered: