Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark Style/IdenticalConditionalBranches as unsafe auto-correction #9985

Commits on Aug 6, 2021

  1. Mark Style/IdenticalConditionalBranches as unsafe auto-correction

    Follow up to rubocop#9982 (comment)
    
    This PR marks `Style/IdenticalConditionalBranches` as unsafe auto-correction.
    
    `Style/IdenticalConditionalBranches` cop is marked unsafe auto-correction
    as the order of method calls must be guaranteed in the following case:
    
    ```ruby
    if method_that_modifies_global_state # 1
      method_that_relies_on_global_state # 2
      foo                                # 3
    else
      method_that_relies_on_global_state # 2
      bar                                # 3
    end
    ```
    
    In such a case, auto-correction may change the invocation order.
    koic committed Aug 6, 2021
    Copy the full SHA
    6059c6d View commit details
    Browse the repository at this point in the history