-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add autofix for magic methods (
ANN204
) (#3633)
- Loading branch information
1 parent
f039bf3
commit f70a49e
Showing
7 changed files
with
405 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
42 changes: 42 additions & 0 deletions
42
crates/ruff/resources/test/fixtures/flake8_annotations/simple_magic_methods.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class Foo: | ||
def __str__(self): | ||
... | ||
|
||
def __repr__(self): | ||
... | ||
|
||
def __len__(self): | ||
... | ||
|
||
def __length_hint__(self): | ||
... | ||
|
||
def __init__(self): | ||
... | ||
|
||
def __del__(self): | ||
... | ||
|
||
def __bool__(self): | ||
... | ||
|
||
def __bytes__(self): | ||
... | ||
|
||
def __format__(self, format_spec): | ||
... | ||
|
||
def __contains__(self, item): | ||
... | ||
|
||
def __complex__(self): | ||
... | ||
|
||
def __int__(self): | ||
... | ||
|
||
def __float__(self): | ||
... | ||
|
||
def __index__(self): | ||
... |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.