-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try to detect non-gloabl unused imports.
We do so by tracking the imports on exist of each scopestack; and on exist, if there is an import that has not been checked; we mark it as unused. This seem to have side effects as the SourceToSource transformer is aware it cannot remove non-global imports and emit a error message. Note that this also affects conditional imports: ``` if sys.version_info > X,y: from foo import bar else: from foo.new import bar ``` The first import will be marked as unused as shoadowed by the second one (pyflyby does not understand the if/else). This also does some refactor and type anotations while I am at it.
- Loading branch information
Showing
3 changed files
with
65 additions
and
32 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
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