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
[Fix #7737] Add new Style/RedundantArguments
cop
#9077
[Fix #7737] Add new Style/RedundantArguments
cop
#9077
Conversation
82db332
to
bf38d80
Compare
config/default.yml
Outdated
Description: 'Check for redundant arguments to methods.' | ||
Enabled: pending | ||
Safe: false | ||
VersionAdded: '1.4' |
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.
Now we use <<next>>
here.
# split: ' ' | ||
# foo: 2 | ||
# | ||
# Limitations: |
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'd put those limitations before the configuration examples.
# | ||
# @example | ||
# # bad | ||
# |
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.
This blank line is redundant.
# "first second".split | ||
# A.foo | ||
class RedundantArguments < Cop | ||
MSG = 'Argument is redundant.' |
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'd expand the message to mention the argument in question and some text saying that the argument is implied by default, so it's clearer what makes it redundant.
bf38d80
to
755785a
Compare
@bbatsov changes done |
Thanks! |
Closes #7737
Previous PR #7761
Before submitting the PR make sure the following are checked:
[Fix #issue-number]
(if the related issue exists).master
(if not - rebase it).bundle exec rake default
. It executes all tests and runs RuboCop on its own code.{change_type}_{change_description}.md
if the new code introduces user-observable changes. See changelog entry format for details.