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
Self assignments have no effect, so probably those are a copy-parse error, missed self for properties or due to incomplete refactoring.
classUserdeffullname=(value)name,surname=value.splitname=name# forgot to use `self`self.surname=surnameendendx=x[a,b]=[a,b]
There is already a Lint/UselessAssignment cop which checks for unused variables after assignment. That cop is a little difficult, as I can say, to extend with this and created with a little different purpose. So I'm proposing creating a new Lint/SelfAssignment cop to handle described use cases. Wdyt?
Self assignments have no effect, so probably those are a copy-parse error, missed
self
for properties or due to incomplete refactoring.There is already a
Lint/UselessAssignment
cop which checks for unused variables after assignment. That cop is a little difficult, as I can say, to extend with this and created with a little different purpose. So I'm proposing creating a newLint/SelfAssignment
cop to handle described use cases. Wdyt?Inspired by https://eslint.org/docs/rules/no-self-assign and https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html#sa-self-assignment-of-field-sa-field-self-assignment and http://errorprone.info/bugpattern/SelfAssignment
The text was updated successfully, but these errors were encountered: