Open vantaboard opened 8 months ago
Creating a RemoveUnusedImports transformer according to the docs does not properly handle the __all__ variable.
RemoveUnusedImports
__all__
I added a test to libcst/metadata/tests/test_scope_provider.py that ensures the imports have references that target the strings in __all__.
libcst/metadata/tests/test_scope_provider.py
Gotta fix the type errors (looks like Name.__init__ needs updating too) and this is good to go!
Name.__init__
Summary
Creating a
RemoveUnusedImports
transformer according to the docs does not properly handle the__all__
variable.Test Plan
I added a test to
libcst/metadata/tests/test_scope_provider.py
that ensures the imports have references that target the strings in__all__
.