sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

Rules that add imports do not show up in the CLI

Open ghost opened this issue 3 years ago • 3 comments

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: bug1 When I now scan the same file using the sourcery cli (installed with pip3 install sourcery-cli), this warning is not shown: bug2

Debug Information

IDE Version: VSCode 1.72.0

Sourcery Version: 0.12.9

Operating system and Version: Ubuntu 22.04

ghost avatar Oct 09 '22 11:10 ghost

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?

reka avatar Oct 10 '22 19:10 reka

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.

reka avatar Oct 11 '22 09:10 reka

Alright, thanks for your help!

ghost avatar Oct 11 '22 09:10 ghost