Skip to content

docs: Add docs for manual testing + submitting PRs. #28

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

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions scip-ruby.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ Updating snapshots
./bazel test //test/scip:update --config=dbg
```

## Manually testing against larger codebases

Some OSS repos that can be used to exercise scip-ruby are:
- [Homebrew/brew](https://github.com/Homebrew/brew): (150k SLOC)
1. Clone and run `./bin/brew typecheck` once.
2. Copy over the built `scip-ruby` binary:
```
cp /path/to/scip-ruby ./Library/Homebrew/vendor/bundle/ruby/2.6.0/bin/srb
```
3. Add a line for indexing
```
diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb
index b9f00a544..aac977019 100644
--- a/Library/Homebrew/dev-cmd/typecheck.rb
+++ b/Library/Homebrew/dev-cmd/typecheck.rb
@@ -124,2 +124,3 @@ module Homebrew
end
+ srb_exec += ["--index-file", "index.scip", "--gem-metadata", "[email protected]"]
success = system(*srb_exec)
```
4. Run `./bin/brew typecheck`. An index should appear under `Library/Homebrew/`.
5. Go to step 2.

## Debugging

So far, I've mostly been using print debugging
Expand All @@ -57,3 +80,18 @@ file under the `test/scip/snapshots/` directory
# View output
./bazel test //test/scip:update_tmp --config=dbg && cat test/scip/testdata/tmp.snapshot.rb
```

Having the [SCIP CLI](https://github.com/sourcegraph/scip) available
is also useful for inspecting the emitted index.

## Creating PRs

PRs created through the GitHub UI default to being made
against the upstream Sorbet repo. It is less error-prone
to use the [GitHub CLI](https://cli.github.com/) instead.

```
gh pr create -R sourcegraph/scip-ruby
```

This will correctly use the `scip-ruby/master` branch as the target.