Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Style/RedundantCondition can generate syntax errors when safe-auto-correcting #8299
In certain situations, Style/RedundantCondition can generate a syntax errors.
I'd expect rubocop to either not auto correct (since it was supposed to be a safe auto-correction), or to not generate invalid code.
rubocop generated code with invalid syntax.
Steps to reproduce the problem
I had a code like this:
Style/RedundantReturn corrected it to:
Which then Style/RedundantCondition auto corrected to: