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 #5388] Add new Style/UnlessMultipleConditions cop #5400

Closed
wants to merge 2 commits into from

Commits on Jan 5, 2018

  1. [Fix rubocop#5388] Add new Style/UnlessMultipleConditions cop

    Fixes rubocop#5388
    
    This cop checks that `unless` is not used with multiple conditions.
    In general, using multiple conditions with `unless` reduces
    readability.
    wata727 committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    a307d3f View commit details
    Browse the repository at this point in the history
  2. Disable Style/UnlessMultipleConditions in RuboCop

    Because RuboCop currently supports Ruby 2.1.
    In Ruby 2.1 not implementing `Hash#dig`, the following code is useful.
    
    ```ruby
    return unless hash[:a] && hash[:a][:b]
    ```
    wata727 committed Jan 5, 2018
    Configuration menu
    Copy the full SHA
    12b65d3 View commit details
    Browse the repository at this point in the history