sourcery
sourcery copied to clipboard
Rules that add imports do not show up in the CLI
Checklist
- [x] I have searched the Sourcery documentation for the issue, and found nothing
- [x] I have checked there are no open bugs referencing the same bug or problem
Description
When I use Sourcery inside of VSCode, it shows me this warning:
When I now scan the same file using the sourcery cli (installed with pip3 install sourcery-cli), this warning is not shown:

Debug Information
IDE Version: VSCode 1.72.0
Sourcery Version: 0.12.9
Operating system and Version: Ubuntu 22.04
Hi @Ascii67 ,
Thanks a lot for reporting this. :+1: That's peculiar.
Is there something about this algorithms.py module that might be relevant for reproducing this :bug: ? :thinking:
E.g. Does it contain any
- syntax errors?
- unusual constructs / code blocks?
- places where a built-in name is overwritten?
Hi @Ascii67 ,
The refactoring use-itertools-product needs to add a new import to the module: itertools. Currently, this is supported in VSCode and PyCharm, but not in the CLI.
I agree that this inconsistency is a :bug: We'll change it, so that we'll at least show the refactoring in the CLI even if we can't fix it.
Alright, thanks for your help!