-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
cascade_invocations: Don't trigger on ?? assignments #57640
Comments
@pq @bwilkerson What do you guys think about this? |
I'm not sure I understand what you're suggesting here. The rule is intended to catch (among other things) code in which the first statement is an assignment. Are you suggesting that we disable the rule for all code containing an assignment (and adjust the rule's description)? (I'm not necessarily opposed, just clarifying.) I agree that it's a problem when the assignment causes an implicit cast or when the assignment needs to happen before the cascaded expressions are executed. We ought to be able to detect the first case, but I don't think we can reliably detect the second case. @alexeieleusis (another issue to contemplate) |
Actually, reading through these issues again, I would like to amend my previous comment. While I originally was indeed suggesting disabling the rule for assignments, I think that's a bit rash. I think we should definitely disable the lint in the case of implicit casts. Whether we do so for assignments with |
I no longer feel passionate about this issue :) |
Yeah, I could have written:
But that really harms readability just to play code golf.
The text was updated successfully, but these errors were encountered: