-
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
…ework after discussion w/zanie
- Loading branch information
Showing
13 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
'''__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 | ||
_ = os | ||
|
||
|
||
|
||
import argparse as argparse # Ok: is redundant alias | ||
|
||
|
||
|
||
import sys # F401: remove unused | ||
|
||
|
||
|
||
# first-party | ||
|
||
|
||
|
||
from . import used # Ok: is used | ||
_ = used | ||
|
||
|
||
|
||
from . import aliased as aliased # Ok: is redundant alias | ||
|
||
|
||
|
||
|
||
|
||
|
||
from . import unused # F401: change to redundant alias | ||
|
||
|
||
|
||
from . import renamed as bees # F401: no fix |
Empty file.
Empty file.
Empty file.
Empty file.
52 changes: 52 additions & 0 deletions
52
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
'''__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 | ||
_ = os | ||
|
||
|
||
|
||
import argparse # Ok: is exported in __all__ | ||
|
||
|
||
|
||
import sys # F401: remove unused | ||
|
||
|
||
|
||
# first-party | ||
|
||
|
||
|
||
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 unused # F401: add to __all__ | ||
|
||
|
||
|
||
#from . import renamed as bees # F401: add to __all__ | ||
|
||
|
||
|
||
__all__ = ["argparse", "exported"] |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
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