sourcery-ai / sourcery

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

VSCode is scanning excluded files in `node_modules/` #431

Open tylerlaprade opened 1 month ago

tylerlaprade commented 1 month ago

Checklist

Description

image

Code snippet that reproduces issue

ignore: # A list of paths or files which Sourcery will ignore.
  - .git
  - venv
  - .venv
  - env
  - .env
  - .tox
  - node_modules
  - .dev-run
  - build

Debug Information

IDE Version: VSCode 1.91.1

Sourcery Version: Sourcery v1.21.0

Operating system and Version: macOS Sonoma 14.5

Hellebore commented 1 month ago

Hi @tylerlaprade - thanks for raising this.

I can't reproduce this at first attempt - could you let me know the structure of your workspace, i.e. which folder do you have open in vscode, are there multiple ones?

tylerlaprade commented 1 month ago

I have one big monorepo with both my front-end and back-end code nested in directories. Just one folder. This "scanning" message remained for many minutes, so eventually I did Developer: Reload Window to get rid of it.

ruancomelli commented 1 month ago

Hey, @tylerlaprade!

Currently, Sourcery interprets the paths listed in the ignore field relative to the project root path. Therefore,

ignore:
  - node_modules

will instruct Sourcery to ignore ./node_modules, but not e.g. ./frontend/node_modules (supposing here that frontend/ is the name of the directory where your front-end code is stored).

To fix this, you need to provide the path to the node-modules directory in your project including intermediate directory names:

ignore:
  - frontend/node_modules

Could you please try this solution and let me know if it works for you? :slightly_smiling_face:

tylerlaprade commented 1 month ago

Thanks! I'm not sure how to trigger that "scanning" thing since it just showed up in my status bar one day, but I still see squiggles from Sourcery if I open up a file from paqarina/node_modules/.

image