-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Check for useless square bracket assignment #639
Comments
Sounds reasonable. I'll look into that. |
Just a comment: rubocop also raises an offence for something like this:
It identifies that method call as a local variable assignment. I didn't find any closed issues about this topic, should a open a new one? |
@fuadsaud that is a local variable assignment, just as rubocop says. You should have done If you have
Then you'll get
|
@agrimm very correct. It was my bad, I didn't know self was required in a case like this. Thanks. |
@yujinakayama @jonas054 What do you think about this? Are we doing it or closing it? |
Though I haven't looked into this, maybe this can be done by extending |
@yujinakayama That's what I thought as well. Would you, please, look into this? |
The following feature request is like #383 , but rather than concerning
foo.bar = baz
, which is covered by UselessSetterCall, it's aboutfoo[bar] = baz
.Using
[]=
on the last line of a method on a local variable is usually a mistake.The text was updated successfully, but these errors were encountered: