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
Shut up UselessMethodDefinition cop #1014
Conversation
@@ -9,11 +9,11 @@ module ExpectOffense | |||
|
|||
DEFAULT_FILENAME = 'example_spec.rb' | |||
|
|||
def expect_offense(source, filename = DEFAULT_FILENAME, *args, **kwargs) | |||
def expect_offense(source, filename = DEFAULT_FILENAME, *args, **kwargs) # rubocop:disable Lint/UselessMethodDefinition |
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.
Because we usually test with an older version of RuboCop, we need to disable Lint/RedundantCopDisableDirective
too.
Maybe a "block" disable will work better than the trailing line comments.
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.
Ha, fair enough.
We could wait until this cop is released like we did here, but it's making the edge build red for the time being.
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.
I guess a green build is better than a few redundant disable directives here and there. We can address them from time to time.
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.
But is this a false positive in UselessMethodDefinition
as it changes the default value for an argument?
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.
It is, yes. Filed rubocop/rubocop#8561
d267a61
to
cb85669
Compare
This fixes
edge-rubocop
CI jobCaused by this bug rubocop/rubocop#8561
Before submitting the PR make sure the following are checked:
master
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).