sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.51k stars 65 forks source link

CLI: "sourcery review ." seems to abort and reports "0 files scanned." #326

Closed ClaasRostock closed 1 year ago

ClaasRostock commented 1 year ago

Checklist

Description

After upgrade from 1.0.3 to 1.0.5, running sourcery from the CLI, i.e. "sourcery review ." starts, shows it scans files, but then, finally, concludes with message "o files scanned.", and in fact issues are not found. Note: The sourcery VS Code extension works and flags the issues. But CLI version seems to not work.

Code snippet that reproduces issue

-/-

Debug Information

IDE Version: VS Code Version: 1.75.1 (user setup) Commit: 441438abd1ac652551dbe4d408dfcec8a499b8bf Date: 2023-02-08T21:32:34.589Z

Sourcery Version: 1.0.5

Operating system and Version: Windows_NT x64 10.0.19044

ruancomelli commented 1 year ago

Hello, @ClaasRostock; thanks for reporting this issue!

I have a few questions to understand better what is going on:

  1. if you create an example file example.py containing some silly code like if False: pass and then run sourcery review example.py, do you get any recommendations?
  2. are you running the CLI and IDE from the same directory?
  3. could you please share your Sourcery log file (possibly located at %LOCALAPPDATA%\sourcery\sourcery.log on your machine) to hello@sourcery.ai? This will help us dig deeper into the causes of that strange behavior.

As a side note, v1.0.5 has a bug that causes it not to count files where no issue was found. So, if no issue was found at all when running sourcery review ., then it will report 0 files scanned even though it has probably scanned a few files. This issue was already fixed and is available from the sourcery-nightly package (or the next stable Sourcery release).

ClaasRostock commented 1 year ago

Dear Ruan,

thank you very much for your notes. I tested the above, now also with v1.0.6, and it seems it was indeed only the counter problem in v1.0.5 I observed. With v1.0.6 this is solved.
You can hence gently close this issue. Best regards :-) Claas