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

Prevent an incorrect auto-correction for Style/CaseEquality cop #8527

Merged

Commits on Aug 17, 2020

  1. Prevent an incorrect auto-correction for Style/CaseEquality cop

    Follow rubocop#8322 (comment)
    
    This PR prevents an incorrect auto-correction for `Style/CaseEquality` cop
    when comparing with `===` against a regular expression receiver.
    
    OTOH, the automatic correction from `a === b` to `a.match?(b)` needs to
    consider `Regexp.last_match?`, `$~`, `$1`, and etc.
    This correction is expected to be supported by `Performance/Regexp` cop.
    See: rubocop/rubocop-performance#152
    koic committed Aug 17, 2020
    Copy the full SHA
    d771985 View commit details
    Browse the repository at this point in the history