Closed foobear closed 4 years ago
I don't particularly mind disabling the cop, but just as a note: It usually does not matter what you return from a setter, since the expression x.foo = "bar"
always evaluates to "bar"
, regardless what you return in the setter. I think it only matters, if you do a x.send(:"foo=", "bar")
or similar.
You are right, that's probably the reasoning of the cop then. Now I'm not sure if I still want to disable it. :smile:
I will close that issue. @foobear feel free to open it again, if you think this is indeed an issue.
Consider the following code where we want to overwrite a setter method to do something after the value has been set.
It causes Rubocop to raise
Lint/Void: Variable result used in void context.
for unknown reasons. The issue only affects Setters, but it is unclear to me why this is a bad thing.A Rubocop issue was closed after not being taken care of, so it seems unlikely to be fixed soon.
I vote for just disabling this cop, as it is not that relevant.