-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[pylint
] Implement assigning-non-slot
(E0237
)
#9623
[pylint
] Implement assigning-non-slot
(E0237
)
#9623
Conversation
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLE0237 | 2 | 2 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+2 -0 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)
DisnakeDev/disnake (+2 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --preview
+ disnake/embeds.py:206:9: PLE0237 Attribute `timestamp` is not defined in class's `__slots__` + disnake/embeds.py:214:9: PLE0237 Attribute `colour` is not defined in class's `__slots__`
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLE0237 | 2 | 2 | 0 | 0 | 0 |
How does Pylint handle this for subclasses? E.g., does it allow items in |
If subclasses define slots, pylint checks not redefining the same slots as its superclass in redefined-slots-in-subclass / W0244. Also we can set new slots in the superclass and pylint checks it in assigning-non-slot / E0237. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tsugumi-sys, I limited the rule to classes that don't inherit from "unknown" parent classes for now.
We actually have support for resolving parent classes within the same file, so we could extend the rule to check that.
assigning-non-slot
/E0237
pylint
] Implement assigning-non-slot
(E0237
)
Summary
Implement assigning-non-slot / E0237
related #970
Test Plan
cargo test