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

Fix move namespaced constant in Style/ConditionalAssignment #8332

Merged
merged 2 commits into from Aug 5, 2020

Commits on Jul 14, 2020

  1. Fix move namespaced constant in Style/ConditionalAssignment

    Fix autocorrect for moving constant assignment outside the condition
    when the constant is in a namespace, e.g. from:
    
    ```ruby
    condition ? FOO::BAR = 1 : FOO::BAR = 2
    
    if condition
      ::FOO = 1
    else
      ::FOO = 2
    end
    ```
    
    to keep the namespace `Foo::` and the top-level `::` in correction:
    
    ```ruby
    FOO::BAR = cond? ? 1 : 2
    
    ::FOO = if condition
      1
    else
      2
    end
    ```
    biinari committed Jul 14, 2020
    Copy the full SHA
    e3bcf91 View commit details
    Browse the repository at this point in the history

Commits on Aug 5, 2020

  1. Copy the full SHA
    ccb4ecb View commit details
    Browse the repository at this point in the history