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 a false positive for Style/CaseEquality cop #8526

Merged

Commits on Sep 14, 2020

  1. Fix a false positive for Style/CaseEquality cop

    Follow rubocop#8322 (comment)
    
    Fix a false positive for `Style/CaseEquality` cop when
    the receiver is not a camel cased constant.
    
    The following constant should not be replaced with `is_a?`.
    What kind of object is actually assigned depends on the constant. e.g.:
    
    ```ruby
    REGEXP_CONSTANT === something #=> does not register an offense.
    ```
    
    This PR will only consider camel-cased constant as class name. e.g.:
    
    ```ruby
    Array === something #=> auto-correct to `something.is_a?(Array)`
    ```
    koic committed Sep 14, 2020
    Copy the full SHA
    252fe51 View commit details
    Browse the repository at this point in the history