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
MemoizedInstanceVariableName Still complaining about leading underscores #6349
Comments
The default configuration disallows leading underscores: https://rubocop.readthedocs.io/en/latest/cops_naming/#namingmemoizedinstancevariablename It seems like you want: |
Hi there @Drenmi think this was closed prematurely. Those documents don't actual stipulate that my method is against rubocop's guidelines. just that other methods are valid. There isn't an instance where Furthermore the error message is actual misleading. Because it's advising me to do something I've already done. To rename my method which was previously named Could someone perhaps shed more light on this, unless I'm missing something obvious this is a legitimate bug. |
I think the problem is the error message
The error message should be
(or maybe something that explains the bit about the underscoring) |
Could someone maybe point me in the right direction here? As it's a reasonably large open source gem I'm running and this is the only dependency which is quite old. |
@luke-hill if you don't agree with it, maybe just turn off this cop.
|
Sure! Try removing this |
Right so it's actually something being worked on currently. That makes sense then. |
I’m not sure anyone is currently working on it. You might be the most motivated for this particular task. |
…ut leading underscores Rewrite the check for the variable name to bear in mind more potential cases.
…thod name The following code should be valid: def _foo @_foo ||= :foo end But before this change it complains that the variable name should be @foo. The rules need to take into account what the method name is, and the configured style.
Expected behavior
Not to report the cop (not present pre 0.58), fixed in 0.58.0
Actual behavior
rubocop 0.57.2 - 1 file inspected 0 failures
rubocop 0.58.2 - 1 file inspected 1 failure
rubocop 0.59.2 - 1 file inspected 1 failure
Steps to reproduce the problem
RuboCop version('s)
The text was updated successfully, but these errors were encountered: