LibCST/libcst
Frank Liu b75343e74e
Create CodemodCommand Remove/Add Import helper functions (#1432)
* Create helper functions to abstract away usage of RemoveImportsVisitor's remove unused import functions in CodemodCommand

* Create helper functions to abstract away usage of AddImportsVisitor's add needed import functions in CodemodCommand

* Add tests for CodemodCommand helper functions

Add comprehensive tests for the new helper methods:
- remove_unused_import
- remove_unused_import_by_node
- add_needed_import

Tests cover simple cases, from imports, aliased imports,
relative imports, and combined add/remove operations.
2025-12-17 09:28:24 -08:00
..
_nodes feat: add support for PEP758 (#1401) 2025-09-09 11:16:49 -04:00
_parser fix: circular import error (#1406) 2025-09-25 23:44:58 -04:00
codegen Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
codemod Create CodemodCommand Remove/Add Import helper functions (#1432) 2025-12-17 09:28:24 -08:00
display Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
helpers Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
matchers Support parsing of t-strings #1374 (#1398) 2025-09-09 11:16:20 -04:00
metadata fixes match statements to work with PositionProvider (#1389) 2025-08-04 17:27:13 -04:00
testing Bump black from 22.12.0 to 23.1.0 (#860) 2023-03-15 11:53:50 +00:00
tests fix: circular import error (#1406) 2025-09-25 23:44:58 -04:00
__init__.py Support parsing of t-strings #1374 (#1398) 2025-09-09 11:16:20 -04:00
_add_slots.py drop support for Python 3.7 (#997) 2023-08-26 12:42:12 +01:00
_batched_visitor.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_exceptions.py Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
_flatten_sentinel.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_maybe_sentinel.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_metadata_dependent.py Implement lazy loading mechanism for QualifiedNameProvider (#720) 2022-07-09 08:34:29 +01:00
_position.py Bump black from 23.12.1 to 24.8.0 (#1186) 2024-08-22 16:46:01 -07:00
_removal_sentinel.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_tabs.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_type_enforce.py remove typing dependencies (#1126) 2024-04-03 19:50:14 +01:00
_typed_visitor.py Support parsing of t-strings #1374 (#1398) 2025-09-09 11:16:20 -04:00
_typed_visitor_base.py Several trivial refactors (#770) 2022-09-14 14:33:45 +01:00
_types.py Pass root path to FullyQualifiedNameProvider (#867) 2023-02-22 14:36:10 -08:00
_visitors.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
py.typed support mypy using py.typed 2019-09-16 13:49:08 -07:00
tool.py Upgrade PyYAML-ft version and use new module name (#1353) 2025-06-10 17:21:21 +01:00