sourcegraph / scip

SCIP Code Intelligence Protocol
Apache License 2.0
262 stars 31 forks source link

Issues running `scip test` #283

Open matthewnitschke-wk opened 1 month ago

matthewnitschke-wk commented 1 month ago

In the newly added scip test subcommand, there was an additional test condition added to ensure that each file in the project folder has a correlating document within the SCIP index. This is a great thing to validate, but it seems like there's a few rough edges in its current implementation.

What I'm seeing is that directories that hold dependencies (.node_modules, .dart_tool, ...) are not default ignored, meaning this test case will always fail assuming your indexer doesn't index these directories. Additionally, scip-dart is not currently indexing both pubspec.yaml and pubspec.lock files, which are also being caught under this same error.

I see a few options for remediating the problem:

varungandhi-src commented 2 weeks ago

Respect the .gitignore within the repo.

I think this is a good default more generally. We can have a --no-ignore flag similar to ripgrep for skipping this. There is a library which might make implementing this easy - https://github.com/boyter/gocodewalker

The addition of a default condition that always validates each file has a correlating document goes slightly against this goal. The test case itself could be added as a flag condition to scip test (scip test --check-documents),

I think this option seems like the simplest one, what do you think?