makandra / makandra-rubocop

makandra's default Rubocop configuration
MIT License
6 stars 1 forks source link

Disable Lint/EmptyWhen #18

Closed denzelem closed 4 years ago

denzelem commented 4 years ago

I would suggest to disable the Lint/EmptyWhen (https://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Lint/EmptyWhen) to allow comments.

Example:

case response.code
when 200
  # nothing to do, everything is fine
when 403
  Rails.logger.info('Here was an 403 error')
else
  raise ArgumentError, "Unknown response code '#{response.code}'"
end

Wdyt?

triskweline commented 4 years ago

The empty when with a comment is such a thoughtful thing to do.