Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --project-root flag to scip stats #187

Merged
merged 4 commits into from
Jul 22, 2023

Conversation

abitrolly
Copy link
Contributor

@abitrolly abitrolly commented Jul 19, 2023

Workaround for #98

This shares logic with bindings/go/scip/testutil/format.go, but I haven't found the best place to put this shared code.

Test plan

$ go build -o scip ./cmd && ./scip stats --from /tmp/index.scip --project-root /data/s/gdk
{
  "documents": 222,
  "linesOfCode": 14789,
  "occurrences": 11324,
  "definitions": 2908
}
$ go build -o scip ./cmd && ./scip stats --from /tmp/index.scip                          
2023/07/19 17:51:48 Project root [/s/gdk] doesn't exist, using current working directory [/home/anatoli/delme/scip] instead. To override this behaviour, specify --project-root=<folder> option
2023/07/19 17:51:48 error counting stats: lstat /home/anatoli/delme/scip/support/compare.rb: no such file or directory 

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this contribution! I just merged #189 which fixes the failing CI. Can you rebase on top of main? LGTM 👍🏻 once the CI is green

@abitrolly
Copy link
Contributor Author

@olafurpg done!

@olafurpg olafurpg merged commit 720091e into sourcegraph:main Jul 22, 2023
@olafurpg
Copy link
Member

olafurpg commented Jul 22, 2023

Thank you!

@abitrolly abitrolly deleted the project-root branch July 22, 2023 08:38
olafurpg pushed a commit that referenced this pull request Jul 24, 2023
* Add `--project-root` flag to `scip stats`

See #98

* Wrap some errors

* Copy `scip stats --project-root` logic from `scip snapshot`

* Fix description of snapshot --project-root option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants