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
I think you mean rubocop -a --only Style/For, but you're right about the reason for the failure. It's the change in scope for the x variable in this case.
I agree. Marking it as unsafe is a simple solution.
Cop Style/For should be marked as unsafe, because it can break code
Reason might be that scopes are different, as quoted from Ruby Style Guide
Expected behavior
I expect safe autocorrection not to break my existing ruby code.
Actual behavior
Running a cop marked as safe breaks my existing ruby code.
Steps to reproduce the problem
When I run rubocop -a --only Style/IdenticalConditionalBranches, it autocorrects my file to:
RuboCop version
The text was updated successfully, but these errors were encountered: