Skip to content

Commit 703e7f9

Browse files
docs: Add docs for manual testing + submitting PRs. (#28)
1 parent 2895e4a commit 703e7f9

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

scip-ruby.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,29 @@ Updating snapshots
3333
./bazel test //test/scip:update --config=dbg
3434
```
3535

36+
## Manually testing against larger codebases
37+
38+
Some OSS repos that can be used to exercise scip-ruby are:
39+
- [Homebrew/brew](https://github.com/Homebrew/brew): (150k SLOC)
40+
1. Clone and run `./bin/brew typecheck` once.
41+
2. Copy over the built `scip-ruby` binary:
42+
```
43+
cp /path/to/scip-ruby ./Library/Homebrew/vendor/bundle/ruby/2.6.0/bin/srb
44+
```
45+
3. Add a line for indexing
46+
```
47+
diff --git a/Library/Homebrew/dev-cmd/typecheck.rb b/Library/Homebrew/dev-cmd/typecheck.rb
48+
index b9f00a544..aac977019 100644
49+
--- a/Library/Homebrew/dev-cmd/typecheck.rb
50+
+++ b/Library/Homebrew/dev-cmd/typecheck.rb
51+
@@ -124,2 +124,3 @@ module Homebrew
52+
end
53+
+ srb_exec += ["--index-file", "index.scip", "--gem-metadata", "[email protected]"]
54+
success = system(*srb_exec)
55+
```
56+
4. Run `./bin/brew typecheck`. An index should appear under `Library/Homebrew/`.
57+
5. Go to step 2.
58+
3659
## Debugging
3760
3861
So far, I've mostly been using print debugging
@@ -57,3 +80,18 @@ file under the `test/scip/snapshots/` directory
5780
# View output
5881
./bazel test //test/scip:update_tmp --config=dbg && cat test/scip/testdata/tmp.snapshot.rb
5982
```
83+
84+
Having the [SCIP CLI](https://github.com/sourcegraph/scip) available
85+
is also useful for inspecting the emitted index.
86+
87+
## Creating PRs
88+
89+
PRs created through the GitHub UI default to being made
90+
against the upstream Sorbet repo. It is less error-prone
91+
to use the [GitHub CLI](https://cli.github.com/) instead.
92+
93+
```
94+
gh pr create -R sourcegraph/scip-ruby
95+
```
96+
97+
This will correctly use the `scip-ruby/master` branch as the target.

0 commit comments

Comments
 (0)