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

Disable Style/EmptyCaseCondition cop. #9

Merged
merged 1 commit into from
Jun 20, 2018

Conversation

drn
Copy link
Member

@drn drn commented Jun 20, 2018

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

@drn drn requested review from davywentworth and marcferna June 20, 2018 07:03
Copy link
Contributor

@marcferna marcferna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good

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
@drn drn force-pushed the Style/EmptyCaseCondition branch from 4a41400 to e9bad31 Compare June 20, 2018 07:29
@drn drn merged commit e9bad31 into thanx:master Jun 20, 2018
@drn drn deleted the Style/EmptyCaseCondition branch June 20, 2018 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants