[pylint] Implement unnecessary-dunder-call (C2801)#9166
Merged
charliermarsh merged 6 commits intoastral-sh:mainfrom Jan 3, 2024
Merged
[pylint] Implement unnecessary-dunder-call (C2801)#9166charliermarsh merged 6 commits intoastral-sh:mainfrom
pylint] Implement unnecessary-dunder-call (C2801)#9166charliermarsh merged 6 commits intoastral-sh:mainfrom
Conversation
42ad4f3 to
d8d25f7
Compare
d8d25f7 to
17798cf
Compare
Contributor
|
| 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
40136bd to
230b3de
Compare
charliermarsh
approved these changes
Jan 3, 2024
C2801/unnecessary-dunder-callspylint] Implement unnecessary-dunder-calls (C2801)
pylint] Implement unnecessary-dunder-calls (C2801)pylint] Implement unnecessary-dunder-call (C2801)
charliermarsh
pushed a commit
that referenced
this pull request
Jan 12, 2024
<!-- 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? -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
C2801/unnecessary-dunder-callsThere 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