mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-01 06:11:21 +00:00
[ty] Use invalid-assignment
error code for invalid assignments to ClassVar
s (#20156)
## Summary This error is about assigning to attributes rather than reading attributes, so I think `invalid-assignment` makes more sense than `invalid-attribute-access` ## Test Plan existing mdtests updated
This commit is contained in:
parent
fa7798ddd9
commit
9b1b58a451
6 changed files with 15 additions and 15 deletions
|
@ -53,7 +53,7 @@ C.attr = 1 # fine
|
|||
C.attr = "wrong" # error: [invalid-assignment]
|
||||
|
||||
instance = C()
|
||||
instance.attr = 1 # error: [invalid-attribute-access]
|
||||
instance.attr = 1 # error: [invalid-assignment]
|
||||
```
|
||||
|
||||
## Unknown attributes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue