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
This is a case that override Rails image_tag for lazyload js. There is no need to expand options to keyword arguments. And the original method signature is exectly image_tag(source, options = {}).
RuboCop isn't capable of reason, so it can't really judge what is reasonable. 🙂
However, I think your example is valuable, because it calls super, which will pass the arguments on, indicating that the hash is expected. We could certainly account for this case.
…r passing to super
Previously the cop would add an offense if a method is defined with an
options hash parameter, intended to be passed into a call to super.
The fix was to check if super is called in the method body, and not
register an offense if found.
This is a case that override Rails
image_tag
for lazyload js. There is no need to expand options to keyword arguments. And the original method signature is exectly image_tag(source, options = {}).So should we check if
options
is used only accessing values or not?Expected behavior
Don't flag an offense.
Actual behavior
Flag an offense.
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: