Skip to content

Commit

Permalink
Disable Style/EmptyCaseCondition cop.
Browse files Browse the repository at this point in the history
https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/EmptyCaseCondition
rubocop/rubocop#3019 (comment)

This allows empty case conditions to support the following:

    case
    when done?     then :paid
    when expired?  then :expired
    when expiring? then :expiring
    else :pending
    end

Instead of requiring:

    if done?
      :paid
    elsif expired?
      :expired
    elsif expiring?
      :expiring
    else
      :pending
    end
  • Loading branch information
drn committed Jun 20, 2018
1 parent f4b6f74 commit e9bad31
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ruby/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ Style/ClassAndModuleChildren:
- nested
- compact

# Allow empty condition in case statements
Style/EmptyCaseCondition:
Enabled: false

Style/MultilineMemoization:
EnforcedStyle: braces
SupportedStyles:
Expand Down

0 comments on commit e9bad31

Please sign in to comment.