We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Received Naming/MemoizedInstanceVariableName incorrectly for methods and variables with surrounding underscores.
No Naming/MemoizedInstanceVariableName warning.
Received message
Naming/MemoizedInstanceVariableName: Memoized variable @__instances__ does not match method name __instances__. Use @__instances__ instead.
@__instances__
__instances__
Run RuboCop over:
require 'set' class Foo def __instances__ @__instances__ ||= Set.new end end
0.63.1 (using Parser 2.5.1.0, running on ruby 2.6.0 x86_64-darwin18)
The text was updated successfully, but these errors were encountered:
Thank you for your reporting!
More small code to reproduce:
def _a @_a ||= x end
This cop does not work well if the method name starts with underscore.
related: #6125
Sorry, something went wrong.
Naming/MemoizedInstanceVariableName
[Fix rubocop#6710] Fix Naming/MemoizedInstanceVariableName on metho…
a688ca2
…d starts with underscore
Merge pull request #6711 from pocke/fix-6710
a41aeb6
[Fix #6710] Fix `Naming/MemoizedInstanceVariableName` on method starts with underscore
pocke
No branches or pull requests
Received Naming/MemoizedInstanceVariableName incorrectly for methods and variables with surrounding underscores.
Expected behavior
No Naming/MemoizedInstanceVariableName warning.
Actual behavior
Received message
Steps to reproduce the problem
Run RuboCop over:
RuboCop version
0.63.1 (using Parser 2.5.1.0, running on ruby 2.6.0 x86_64-darwin18)
The text was updated successfully, but these errors were encountered: