-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
2 changed files
with
19 additions
and
40 deletions.
There are no files selected for viewing
29 changes: 9 additions & 20 deletions
29
crates/ruff_linter/resources/test/fixtures/pyflakes/F401_24/__init__.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 |
---|---|---|
@@ -1,47 +1,36 @@ | ||
'''__init__.py without __all__ | ||
"""__init__.py without __all__ | ||
Unused stdlib and third party imports are unsafe removals | ||
Unused first party imports get changed to redundant aliases | ||
''' | ||
|
||
""" | ||
|
||
|
||
# stdlib | ||
|
||
import os # Ok: is used | ||
|
||
|
||
import os # Ok: is used | ||
_ = os | ||
|
||
|
||
|
||
import argparse as argparse # Ok: is redundant alias | ||
import argparse as argparse # Ok: is redundant alias | ||
|
||
|
||
|
||
import sys # F401: remove unused | ||
|
||
import sys # F401: remove unused | ||
|
||
|
||
# first-party | ||
|
||
|
||
from . import used # Ok: is used | ||
|
||
from . import used # Ok: is used | ||
_ = used | ||
|
||
|
||
from . import aliased as aliased # Ok: is redundant alias | ||
|
||
from . import aliased as aliased # Ok: is redundant alias | ||
|
||
|
||
|
||
|
||
|
||
|
||
from . import unused # F401: change to redundant alias | ||
|
||
from . import unused # F401: change to redundant alias | ||
|
||
|
||
from . import renamed as bees # F401: no fix | ||
from . import renamed as bees # F401: no fix |
30 changes: 10 additions & 20 deletions
30
crates/ruff_linter/resources/test/fixtures/pyflakes/F401_25__all/__init__.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 |
---|---|---|
@@ -1,52 +1,42 @@ | ||
'''__init__.py with __all__ | ||
"""__init__.py with __all__ | ||
Unused stdlib and third party imports are unsafe removals | ||
Unused first party imports get added to __all__ | ||
''' | ||
|
||
""" | ||
|
||
|
||
# stdlib | ||
|
||
import os # Ok: is used | ||
|
||
|
||
import os # Ok: is used | ||
_ = os | ||
|
||
|
||
import argparse # Ok: is exported in __all__ | ||
|
||
import argparse # Ok: is exported in __all__ | ||
|
||
|
||
|
||
import sys # F401: remove unused | ||
|
||
import sys # F401: remove unused | ||
|
||
|
||
# first-party | ||
|
||
|
||
from . import used # Ok: is used | ||
|
||
from . import used # Ok: is used | ||
_ = used | ||
|
||
|
||
|
||
from . import aliased as aliased # Ok: is redundant alias | ||
|
||
|
||
|
||
from . import exported # Ok: is exported in __all__ | ||
|
||
from . import aliased as aliased # Ok: is redundant alias | ||
|
||
|
||
#from . import unused # F401: add to __all__ | ||
from . import exported # Ok: is exported in __all__ | ||
|
||
|
||
# from . import unused # F401: add to __all__ | ||
|
||
#from . import renamed as bees # F401: add to __all__ | ||
|
||
# from . import renamed as bees # F401: add to __all__ | ||
|
||
|
||
__all__ = ["argparse", "exported"] |