-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
4 more rubocop fixes #852
4 more rubocop fixes #852
Conversation
@@ -78,7 +78,8 @@ def self.get_job(job, catalog = nil) | |||
# currently unused | |||
def self.job_enabled(job, catalog = nil) | |||
raw = clihelper(['job_enabled', job], catalog: catalog) | |||
!!(raw =~ %r{true}) | |||
return true if raw =~ %r{true} | |||
false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's probably a better way that still doesn't use !!
. Open to suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://stackoverflow.com/a/41707707 suggests raw =~ %r{true} ? true : false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the concern here? The meaning of !!
is non-ambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jhoblitt I don't disagree, and others also share your view. eg See rubocop/ruby-style-guide#591
Meanwhile, I think @ekohl's suggestion is less ugly than using a control comment.
!!(raw =~ %r{true}) # rubocop:disable Style/DoubleNegation
I've been trying to get rid of .rubocop_todo.yml so that we can finally do the modulesync required for us to be able to release using the normal Vox Pupuli process. With this PR we're down to 'just' 196 violations having originally started at more than 3000. We probably will end up using some control comments to disable certain cops, but I've been trying to resist so far.
e7270fd
to
c24ddae
Compare
No description provided.