Dataclasses: Detect subclasses trying setting a classvar for an inherited field
It would be nice if Ruff was able to detect this case:
No linter available detects the case in B, which can lead to unexpected behavior.
../Frenck
This seems sensible, but it's worth noting we are currently limited to looking for base classes in the same file so if your base dataclass type is defined somewhere else we will not be able to say if the field exists on it.
@zanieb, what I understand is that this is a request for a new rule, and what you're saying is that implementing the rule today would be limited by the fact that Ruff doesn't support multi-file analysis. Is my understanding correct?
@MichaReiser that sounds right to me.