You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just found a bug in my code which could have been found by a Cop.
def method(args)
return enum_for(:method, args) unless block_given?
# never used args in this method
end
args argument is really used, but this idiom is very often used and it can tell me, that I used it only in enum_for
Describe the solution you'd like
I'd like to have a cop, which would tell me, that args is unused method argument.
It should complain, if receiver of enum_for is nil of self and the first argument is __method__
I don't know if UnusedMethodArgument, ToEnumArguments or a new Cop should cover it.
Problem description
I just found a bug in my code which could have been found by a Cop.
args argument is really used, but this idiom is very often used and it can tell me, that I used it only in
enum_for
Describe the solution you'd like
I'd like to have a cop, which would tell me, that
args
is unused method argument.It should complain, if receiver of enum_for is nil of self and the first argument is
__method__
I don't know if UnusedMethodArgument, ToEnumArguments or a new Cop should cover it.
It is closely connected to #7753
The text was updated successfully, but these errors were encountered: