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

Add AllowMethodComparison option for Lint/MultipleComparison #8953

Commits on Oct 27, 2020

  1. Add AllowMethodComparison option for Lint/MultipleComparison

    Follow rubocop#8939 (comment).
    
    This PR adds `AllowMethodComparison` option for `Lint/MultipleComparison`.
    
    ```ruby
    # @example AllowMethodComparison: true (default)
    #   # good
    #   foo if a == b.lightweight || a == b.heavyweight
    #
    # @example AllowMethodComparison: false
    #   # bad
    #   foo if a == b.lightweight || a == b.heavyweight
    #
    #   # good
    #   foo if [b.lightweight, b.heavyweight].include?(a)
    ```
    koic committed Oct 27, 2020
    Copy the full SHA
    e56d84a View commit details
    Browse the repository at this point in the history