-
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 unnecessary-dunder-call
(C2801
)
#9166
Conversation
42ad4f3
to
d8d25f7
Compare
d8d25f7
to
17798cf
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLC2801 | 490 | 490 | 0 | 0 | 0 |
E711 | 1 | 1 | 0 | 0 | 0 |
504f0cf
to
2af5c87
Compare
2af5c87
to
90ff72b
Compare
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.
Reviewing now...
40136bd
to
230b3de
Compare
C2801
/unnecessary-dunder-calls
pylint
] Implement unnecessary-dunder-calls
(C2801
)
pylint
] Implement unnecessary-dunder-calls
(C2801
)pylint
] Implement unnecessary-dunder-call
(C2801
)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary Fix the message for `__aenter__ ` in PLC2801 (introduced in #9166) There is no `aenter` builtin in Python, so the current message is misleading. I take the message from original lint https://github.com/pylint-dev/pylint/blob/main/pylint/constants.py#L211 P.S. I think here should be more accurate synchronization with original lint (e.g. the current implementation will not lint `__enter__` on my first sight), but it is out-of-scope of this change. <!-- What's the purpose of the change? What does it do, and why? --> ## Test Plan <!-- How was it tested? -->
Summary
Implements
C2801
/unnecessary-dunder-calls
There are more that this could cover, but the implementations get a little less straightforward and ugly. Might come back to it in a future PR, or someone else can!
See: #970
Test Plan
cargo test