Simplify import checking with LibCST's FullyQualifiedNameProvider
browniebroke opened this issue · comments
Bruno Alla commented
Is your feature request related to a problem? Please describe.
LibCST 0.3.18 added a FullyQualifiedNameProvider
which seems like it could help us simplify our checks for imported symbols:
https://libcst.readthedocs.io/en/latest/metadata.html#libcst.metadata.FullyQualifiedNameProvider
Describe the solution you'd like
https://github.com/browniebroke/django-codemod/blob/main/django_codemod/visitors/base.py
Especially, the code from BaseRenameTransformer.leave_ImportFrom
seems like a good candidate.