remove_import
Removes a specified import line from a source or config file by matching its text with surrounding whitespace stripped, helping clean up unused imports.
Instructions
Remove an import line, matched by its text with surrounding whitespace stripped.
Use this when: removing an unused import. Don't use this when: removing one name from a multi-name import (remove_import_name).
Example: import_text="import os"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to the source or config file. | |
| import_text | Yes | Exact import line to remove (e.g. 'import os'). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |