Skip to content
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 cop suggests syntactically invalid instance variable for predicate methods. #5670

Closed
cabello opened this issue Mar 12, 2018 · 0 comments
Labels

Comments

@cabello
Copy link

cabello commented Mar 12, 2018

Continuation of #5648

Expected behavior

It should not suggest replacing @full_name with @full_name!

Actual behavior

app/models/client.rb:93:5: C: Naming/MemoizedInstanceVariableName: Memoized variable @full_name does not match method name full_name!. Use @full_name! instead.

Rubocop wants me to change the instance variable to @full_name!, which is not valid.

Steps to reproduce the problem

def full_name!
  @full_name ||= 'fetch full name'
end

RuboCop version

0.53.0

@pocke pocke added the bug label Mar 14, 2018
pocke added a commit to pocke/rubocop that referenced this issue Mar 14, 2018
This was referenced Mar 21, 2018
This was referenced Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants