-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Uncommunicative{MethodArg,BlockParam}Name fails for * #5436
Comments
The name of the two cops is inconsistent, too:
|
Maybe we should add an exception about this indeed. But I recall we discussed with others that something like Perhaps we can have a different cop to check for this though. Not sure at this point. |
Good catch. Should be |
That makes sense. I recall Rubocop at some point in the past suggesting me to change unused args from |
TIL that you can still pass args to |
Ah, here we go:
|
Ah, yeah. Now I remembered this as well. Personally I always used |
At the moment, parameters are (incorrectly) referred to as arguments in most of the codebase I think. Perhaps that needs a more sweeping refactoring if it is becoming a problem. |
Could someone point me towards an explanation why This is not an argument for/against a change. I'm just wondering where the source of truth is with method parameter/argument terminology. |
As I understand it, a parameter is the name of the variable defined in the method, so
An argument is the value that you pass to a function, so
See e.g. this StackOverflow post for some more discussion on the subject. |
The distinction becomes a little vague in this situation:
|
Thanks for the clarification here! I'll change the name of the new cop. |
Does this also handle |
Follow up this comment rubocop#5436 (comment) See also rubocop#5462
Follow up this comment #5436 (comment) See also #5462
Expected behavior
UncommunicativeMethodArgName
andUncommunicativeBlockParamName
should not trigger when given*
as an argument.Actual behavior
UncommunicativeMethodArgName
andUncommunicativeBlockParamName
treat a*
argument as an offense.Steps to reproduce the problem
Create a file with contents:
Run Rubocop:
RuboCop version
4c15154 from Git (past 0.52.1)
The text was updated successfully, but these errors were encountered: