LibCST/libcst/codemod
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
..
commands Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
tests Create CodemodCommand Remove/Add Import helper functions (#1432) 2025-12-17 09:28:24 -08:00
visitors generate Attribute nodes when applying type annotations (#1396) 2025-09-03 16:54:44 -04:00
__init__.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_cli.py Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
_codemod.py Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00
_command.py Create CodemodCommand Remove/Add Import helper functions (#1432) 2025-12-17 09:28:24 -08:00
_context.py Support module and package names in the codemod context (#662) 2022-03-23 14:17:25 -04:00
_dummy_pool.py Enable support for free-threading (#1295) 2025-05-25 11:43:18 +01:00
_runner.py Fix license headers (#560) 2021-12-28 11:55:18 +00:00
_testing.py Fix all type errors (#579) 2022-01-05 18:13:01 +00:00
_visitor.py Avoid raising bare Exception (#1168) 2025-06-07 01:53:44 -07:00