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
The current implementation will not complain about unused method arguments if the method raises a NotImplementedError (it was implemented in this PR: #7739).
However, many recommend against raising this exception in your code:
Its actual meaning is different than the name implies – according to RubyDoc it should be raised when a feature is not implemented on the current platform, think of low-level things like calling fork or fsync.
It's a descendant of ScriptError so a standard rescue block will not capture this, which may cause unexpected problems.
There is also ongoing discussion in this sibling repo to Rubocop:
First of all, thanks for an awesome project! 🏅
The current implementation will not complain about unused method arguments if the method raises a
NotImplementedError
(it was implemented in this PR: #7739).However, many recommend against raising this exception in your code:
These three posts all boil down to:
ScriptError
so a standard rescue block will not capture this, which may cause unexpected problems.There is also ongoing discussion in this sibling repo to Rubocop:
Downside
It's somewhat weird to have
def read_db(_name)
, where the real method name isname
.Possible solution
IgnoredExceptions
(array type), with the default value of['NotImplementedError']
.IgnoreNotImplementedMethods
tofalse
would need to update their config to useIgnoredExceptions: []
intead.IgnoreNotImplementedMethods
and remove it in the next major.@abstract
keyword to be used as another signal to disable this lint check on a method.NotImplementedError
(if you think the reasons for doing so makes sense).Docs for Lint/UnusedMethodArgument
Addendum
Also, I realize this is nuanced. So feel free to close this issue if you think it's irrelevant or that the current logic is "good enough".
The text was updated successfully, but these errors were encountered: