From 860dae24d68f1fd6edd8a27c7be634f1f3f76875 Mon Sep 17 00:00:00 2001 From: Varun Gandhi Date: Mon, 24 Jul 2023 20:06:44 +0800 Subject: [PATCH] cmd: Move binary under new scip/ subdirectory (#191) ## Test plan Covered by existing tests --- .github/workflows/release.yml | 2 +- .github/workflows/reprolang.yml | 2 +- .github/workflows/rust.yml | 2 +- .gitignore | 2 -- Development.md | 18 +++++++++--------- Readme.md | 2 +- cmd/{ => scip}/convert.go | 0 cmd/{ => scip}/lint.go | 0 cmd/{ => scip}/lint_test.go | 0 cmd/{ => scip}/main.go | 0 cmd/{ => scip}/main_test.go | 4 ++-- cmd/{ => scip}/option_from.go | 0 cmd/{ => scip}/print.go | 0 cmd/{ => scip}/print_test.go | 0 cmd/{ => scip}/snapshot.go | 0 cmd/{ => scip}/stats.go | 0 cmd/{ => scip}/tests/reprolang/.gitattributes | 0 cmd/{ => scip}/tests/reprolang/.gitignore | 0 cmd/{ => scip}/tests/reprolang/Cargo.lock | 0 cmd/{ => scip}/tests/reprolang/Cargo.toml | 2 +- cmd/{ => scip}/tests/reprolang/binding.gyp | 0 .../tests/reprolang/bindings/go/repro/ast.go | 0 .../reprolang/bindings/go/repro/dependency.go | 0 .../reprolang/bindings/go/repro/indexer.go | 0 .../tests/reprolang/bindings/go/repro/namer.go | 0 .../reprolang/bindings/go/repro/parser.go | 2 +- .../tests/reprolang/bindings/go/repro/scip.go | 0 .../reprolang/bindings/go/repro/source_file.go | 0 .../tests/reprolang/bindings/node/binding.cc | 0 .../tests/reprolang/bindings/node/index.js | 0 .../tests/reprolang/bindings/rust/build.rs | 0 .../tests/reprolang/bindings/rust/lib.rs | 0 .../reprolang/generate-tree-sitter-parser.sh | 2 +- cmd/{ => scip}/tests/reprolang/grammar.js | 0 cmd/{ => scip}/tests/reprolang/package.json | 0 cmd/{ => scip}/tests/reprolang/src/binding.go | 0 .../tests/reprolang/src/binding_test.go | 0 .../tests/reprolang/src/grammar.json | 0 .../tests/reprolang/src/node-types.json | 0 cmd/{ => scip}/tests/reprolang/src/parser.c | 0 .../tests/reprolang/src/tree_sitter/parser.h | 0 .../tests/reprolang/src/workaround.go | 0 .../input/cyclic-reference/cycle1.repro | 0 .../input/cyclic-reference/cycle2.repro | 0 .../snapshots/input/duplicates/duplicate.repro | 0 .../input/global-cross-repo/reference.repro | 0 .../input/implementation-cross-repo/bird.repro | 0 .../input/implementation/animal.repro | 0 .../input/local-document/local1.repro | 0 .../input/local-document/local2.repro | 0 .../missing-symbol-information/globals.repro | 0 .../missing-symbol-information/locals.repro | 0 .../input/relationships/defined_by.repro | 0 .../snapshots/input/relationships/mixed.repro | 0 .../input/relationships/references.repro | 0 .../input/relationships/type_defines.repro | 0 .../output/cyclic-reference/cycle1.repro | 0 .../output/cyclic-reference/cycle2.repro | 0 .../output/cyclic-reference/dump.lsif | 0 .../snapshots/output/duplicates/dump.lsif | 0 .../output/duplicates/duplicate.repro | 0 .../output/global-cross-repo/dump.lsif | 0 .../output/global-cross-repo/reference.repro | 0 .../implementation-cross-repo/bird.repro | 0 .../output/implementation-cross-repo/dump.lsif | 0 .../output/implementation/animal.repro | 0 .../snapshots/output/implementation/dump.lsif | 0 .../snapshots/output/local-document/dump.lsif | 0 .../output/local-document/local1.repro | 0 .../output/local-document/local2.repro | 0 .../missing-symbol-information/dump.lsif | 0 .../missing-symbol-information/globals.repro | 0 .../missing-symbol-information/locals.repro | 0 .../output/relationships/defined_by.repro | 0 .../snapshots/output/relationships/dump.lsif | 0 .../snapshots/output/relationships/mixed.repro | 0 .../output/relationships/references.repro | 0 .../output/relationships/type_defines.repro | 0 cmd/{ => scip}/version.txt | 0 dev/publish-release.sh | 4 ++-- package.json | 2 +- 81 files changed, 21 insertions(+), 23 deletions(-) rename cmd/{ => scip}/convert.go (100%) rename cmd/{ => scip}/lint.go (100%) rename cmd/{ => scip}/lint_test.go (100%) rename cmd/{ => scip}/main.go (100%) rename cmd/{ => scip}/main_test.go (95%) rename cmd/{ => scip}/option_from.go (100%) rename cmd/{ => scip}/print.go (100%) rename cmd/{ => scip}/print_test.go (100%) rename cmd/{ => scip}/snapshot.go (100%) rename cmd/{ => scip}/stats.go (100%) rename cmd/{ => scip}/tests/reprolang/.gitattributes (100%) rename cmd/{ => scip}/tests/reprolang/.gitignore (100%) rename cmd/{ => scip}/tests/reprolang/Cargo.lock (100%) rename cmd/{ => scip}/tests/reprolang/Cargo.toml (83%) rename cmd/{ => scip}/tests/reprolang/binding.gyp (100%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/ast.go (100%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/dependency.go (100%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/indexer.go (100%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/namer.go (100%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/parser.go (96%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/scip.go (100%) rename cmd/{ => scip}/tests/reprolang/bindings/go/repro/source_file.go (100%) rename cmd/{ => scip}/tests/reprolang/bindings/node/binding.cc (100%) rename cmd/{ => scip}/tests/reprolang/bindings/node/index.js (100%) rename cmd/{ => scip}/tests/reprolang/bindings/rust/build.rs (100%) rename cmd/{ => scip}/tests/reprolang/bindings/rust/lib.rs (100%) rename cmd/{ => scip}/tests/reprolang/generate-tree-sitter-parser.sh (83%) rename cmd/{ => scip}/tests/reprolang/grammar.js (100%) rename cmd/{ => scip}/tests/reprolang/package.json (100%) rename cmd/{ => scip}/tests/reprolang/src/binding.go (100%) rename cmd/{ => scip}/tests/reprolang/src/binding_test.go (100%) rename cmd/{ => scip}/tests/reprolang/src/grammar.json (100%) rename cmd/{ => scip}/tests/reprolang/src/node-types.json (100%) rename cmd/{ => scip}/tests/reprolang/src/parser.c (100%) rename cmd/{ => scip}/tests/reprolang/src/tree_sitter/parser.h (100%) rename cmd/{ => scip}/tests/reprolang/src/workaround.go (100%) rename cmd/{ => scip}/tests/snapshots/input/cyclic-reference/cycle1.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/cyclic-reference/cycle2.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/duplicates/duplicate.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/global-cross-repo/reference.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/implementation-cross-repo/bird.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/implementation/animal.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/local-document/local1.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/local-document/local2.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/missing-symbol-information/globals.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/missing-symbol-information/locals.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/relationships/defined_by.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/relationships/mixed.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/relationships/references.repro (100%) rename cmd/{ => scip}/tests/snapshots/input/relationships/type_defines.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/cyclic-reference/cycle1.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/cyclic-reference/cycle2.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/cyclic-reference/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/duplicates/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/duplicates/duplicate.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/global-cross-repo/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/global-cross-repo/reference.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/implementation-cross-repo/bird.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/implementation-cross-repo/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/implementation/animal.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/implementation/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/local-document/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/local-document/local1.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/local-document/local2.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/missing-symbol-information/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/missing-symbol-information/globals.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/missing-symbol-information/locals.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/relationships/defined_by.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/relationships/dump.lsif (100%) rename cmd/{ => scip}/tests/snapshots/output/relationships/mixed.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/relationships/references.repro (100%) rename cmd/{ => scip}/tests/snapshots/output/relationships/type_defines.repro (100%) rename cmd/{ => scip}/version.txt (100%) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 475d10e3..a8363b3f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} sha256sum: true - project_path: cmd + project_path: cmd/scip binary_name: scip ldflags: "-X 'main.Reproducible=true'" asset_name: scip-${{ matrix.goos }}-${{ matrix.goarch }} diff --git a/.github/workflows/reprolang.yml b/.github/workflows/reprolang.yml index de632f5a..e75ca9c5 100644 --- a/.github/workflows/reprolang.yml +++ b/.github/workflows/reprolang.yml @@ -14,5 +14,5 @@ jobs: - uses: ./.github/actions/asdf with: js: true - - run: ./cmd/tests/reprolang/generate-tree-sitter-parser.sh + - run: ./cmd/scip/tests/reprolang/generate-tree-sitter-parser.sh - run: git diff --exit-code diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 57ed83dd..1e557232 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,4 +19,4 @@ jobs: - run: cargo check working-directory: bindings/rust - run: cargo check - working-directory: cmd/tests/reprolang + working-directory: cmd/scip/tests/reprolang diff --git a/.gitignore b/.gitignore index 3df9077e..b9524ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -13,8 +13,6 @@ *.test # CLI binary -cmd/cmd -cmd/scip /scip # Output of the go coverage tool, specifically when used with LiteIDE diff --git a/Development.md b/Development.md index 6f88ca46..fb0df8da 100644 --- a/Development.md +++ b/Development.md @@ -15,12 +15,12 @@ functionality, such as for converting a SCIP index into an LSIF index. This is used by the CLI below as well as the [Sourcegraph CLI](https://github.com/sourcegraph/src-cli). -- [cmd/](./cmd/): CLI for SCIP. - - [cmd/tests/](./cmd/tests/): Test data and packages for SCIP. - - [cmd/tests/reprolang/](./cmd/tests/reprolang/): A verbose, small language +- [cmd/scip](./cmd/scip): CLI for SCIP. + - [cmd/scip/tests/](./cmd/scip/tests/): Test data and packages for SCIP. + - [cmd/scip/tests/reprolang/](./cmd/scip/tests/reprolang/): A verbose, small language which consists of declarations, references, imports and other minor bits of functionality, which is used to test the SCIP CLI. The language is - defined using a [tree-sitter grammar](cmd/tests/reprolang/grammar.js). + defined using a [tree-sitter grammar](cmd/scip/tests/reprolang/grammar.js). This functionality not meant for use outside of this repository. - [docs/](./docs/): Auto-generated documentation. @@ -33,11 +33,11 @@ For the Haskell bindings, see `bindings/haskell/README.md`. 2. Regenerating snapshots after making changes to the CLI. ``` - go test ./cmd -update-snapshots + go test ./cmd/scip -update-snapshots ``` 3. Regenerating parser for Repro after editing its grammar. ``` - cd cmd/tests/reprolang + cd cmd/scip/tests/reprolang ./generate-tree-sitter-parser.sh ``` @@ -76,19 +76,19 @@ To do this, add a test file (and implement any new functionality) first. Then, regenerate the LSIF index with absolute paths. ```bash -go test ./cmd -update-snapshots -debug-snapshot-abspaths +go test ./cmd/scip -update-snapshots -debug-snapshot-abspaths ``` The LSIF index can be uploaded to a local Sourcegraph instance using: ```bash -PACKAGE=MY_PACKAGE_NAME SRC_ACCESS_TOKEN=MY_TOKEN SRC_ENDPOINT=https://sourcegraph.test:3443 src code-intel upload -file="cmd/tests/snapshots/output/$PACKAGE/dump.lsif" -root="cmd/tests/snapshots/input/$PACKAGE" +PACKAGE=MY_PACKAGE_NAME SRC_ACCESS_TOKEN=MY_TOKEN SRC_ENDPOINT=https://sourcegraph.test:3443 src code-intel upload -file="cmd/scip/tests/snapshots/output/$PACKAGE/dump.lsif" -root="cmd/scip/tests/snapshots/input/$PACKAGE" ``` ## Release a new version First, add release notes to the [CHANGELOG](CHANGELOG.md). -Next, update the version in `cmd/version.txt`. +Next, update the version in `cmd/scip/version.txt`. After landing a commit with those two changes, run the release script: (requires the [GitHub CLI](https://cli.github.com/)) diff --git a/Readme.md b/Readme.md index dc30ecb4..d9abfe31 100644 --- a/Readme.md +++ b/Readme.md @@ -58,7 +58,7 @@ You can also compile a binary locally using: ```sh git clone https://github.com/sourcegraph/scip.git --depth=1 cd scip -go build -o scip ./cmd +go build ./cmd/scip ``` You can consult the [CLI reference](docs/CLI.md) or `--help` for usage information. diff --git a/cmd/convert.go b/cmd/scip/convert.go similarity index 100% rename from cmd/convert.go rename to cmd/scip/convert.go diff --git a/cmd/lint.go b/cmd/scip/lint.go similarity index 100% rename from cmd/lint.go rename to cmd/scip/lint.go diff --git a/cmd/lint_test.go b/cmd/scip/lint_test.go similarity index 100% rename from cmd/lint_test.go rename to cmd/scip/lint_test.go diff --git a/cmd/main.go b/cmd/scip/main.go similarity index 100% rename from cmd/main.go rename to cmd/scip/main.go diff --git a/cmd/main_test.go b/cmd/scip/main_test.go similarity index 95% rename from cmd/main_test.go rename to cmd/scip/main_test.go index fcdf7a5e..7100dd5f 100644 --- a/cmd/main_test.go +++ b/cmd/scip/main_test.go @@ -15,7 +15,7 @@ import ( "github.com/sourcegraph/scip/bindings/go/scip" "github.com/sourcegraph/scip/bindings/go/scip/testutil" - "github.com/sourcegraph/scip/cmd/tests/reprolang/bindings/go/repro" + "github.com/sourcegraph/scip/cmd/scip/tests/reprolang/bindings/go/repro" ) func TestMain(m *testing.M) { @@ -25,7 +25,7 @@ func TestMain(m *testing.M) { func TestCLIReferenceInSync(t *testing.T) { app := scipApp() - readmeBytes, err := os.ReadFile(filepath.Join("..", "docs", "CLI.md")) + readmeBytes, err := os.ReadFile(filepath.Join("..", "..", "docs", "CLI.md")) require.Nil(t, err) readme := string(readmeBytes) diff --git a/cmd/option_from.go b/cmd/scip/option_from.go similarity index 100% rename from cmd/option_from.go rename to cmd/scip/option_from.go diff --git a/cmd/print.go b/cmd/scip/print.go similarity index 100% rename from cmd/print.go rename to cmd/scip/print.go diff --git a/cmd/print_test.go b/cmd/scip/print_test.go similarity index 100% rename from cmd/print_test.go rename to cmd/scip/print_test.go diff --git a/cmd/snapshot.go b/cmd/scip/snapshot.go similarity index 100% rename from cmd/snapshot.go rename to cmd/scip/snapshot.go diff --git a/cmd/stats.go b/cmd/scip/stats.go similarity index 100% rename from cmd/stats.go rename to cmd/scip/stats.go diff --git a/cmd/tests/reprolang/.gitattributes b/cmd/scip/tests/reprolang/.gitattributes similarity index 100% rename from cmd/tests/reprolang/.gitattributes rename to cmd/scip/tests/reprolang/.gitattributes diff --git a/cmd/tests/reprolang/.gitignore b/cmd/scip/tests/reprolang/.gitignore similarity index 100% rename from cmd/tests/reprolang/.gitignore rename to cmd/scip/tests/reprolang/.gitignore diff --git a/cmd/tests/reprolang/Cargo.lock b/cmd/scip/tests/reprolang/Cargo.lock similarity index 100% rename from cmd/tests/reprolang/Cargo.lock rename to cmd/scip/tests/reprolang/Cargo.lock diff --git a/cmd/tests/reprolang/Cargo.toml b/cmd/scip/tests/reprolang/Cargo.toml similarity index 83% rename from cmd/tests/reprolang/Cargo.toml rename to cmd/scip/tests/reprolang/Cargo.toml index a07f455b..5b1df93c 100644 --- a/cmd/tests/reprolang/Cargo.toml +++ b/cmd/scip/tests/reprolang/Cargo.toml @@ -2,7 +2,7 @@ name = "tree-sitter-repro" description = "repro grammar for the tree-sitter parsing library" version = "0.1.0" -repository = "https://github.com/sourcegraph/scip/cmd/tests/reprolang" +repository = "https://github.com/sourcegraph/scip/cmd/scip/tests/reprolang" edition = "2021" license = "Apache-2.0" diff --git a/cmd/tests/reprolang/binding.gyp b/cmd/scip/tests/reprolang/binding.gyp similarity index 100% rename from cmd/tests/reprolang/binding.gyp rename to cmd/scip/tests/reprolang/binding.gyp diff --git a/cmd/tests/reprolang/bindings/go/repro/ast.go b/cmd/scip/tests/reprolang/bindings/go/repro/ast.go similarity index 100% rename from cmd/tests/reprolang/bindings/go/repro/ast.go rename to cmd/scip/tests/reprolang/bindings/go/repro/ast.go diff --git a/cmd/tests/reprolang/bindings/go/repro/dependency.go b/cmd/scip/tests/reprolang/bindings/go/repro/dependency.go similarity index 100% rename from cmd/tests/reprolang/bindings/go/repro/dependency.go rename to cmd/scip/tests/reprolang/bindings/go/repro/dependency.go diff --git a/cmd/tests/reprolang/bindings/go/repro/indexer.go b/cmd/scip/tests/reprolang/bindings/go/repro/indexer.go similarity index 100% rename from cmd/tests/reprolang/bindings/go/repro/indexer.go rename to cmd/scip/tests/reprolang/bindings/go/repro/indexer.go diff --git a/cmd/tests/reprolang/bindings/go/repro/namer.go b/cmd/scip/tests/reprolang/bindings/go/repro/namer.go similarity index 100% rename from cmd/tests/reprolang/bindings/go/repro/namer.go rename to cmd/scip/tests/reprolang/bindings/go/repro/namer.go diff --git a/cmd/tests/reprolang/bindings/go/repro/parser.go b/cmd/scip/tests/reprolang/bindings/go/repro/parser.go similarity index 96% rename from cmd/tests/reprolang/bindings/go/repro/parser.go rename to cmd/scip/tests/reprolang/bindings/go/repro/parser.go index 38fea366..8c2bd09e 100644 --- a/cmd/tests/reprolang/bindings/go/repro/parser.go +++ b/cmd/scip/tests/reprolang/bindings/go/repro/parser.go @@ -2,7 +2,7 @@ package repro import ( "context" - reproGrammar "github.com/sourcegraph/scip/cmd/tests/reprolang/src" + reproGrammar "github.com/sourcegraph/scip/cmd/scip/tests/reprolang/src" sitter "github.com/smacker/go-tree-sitter" diff --git a/cmd/tests/reprolang/bindings/go/repro/scip.go b/cmd/scip/tests/reprolang/bindings/go/repro/scip.go similarity index 100% rename from cmd/tests/reprolang/bindings/go/repro/scip.go rename to cmd/scip/tests/reprolang/bindings/go/repro/scip.go diff --git a/cmd/tests/reprolang/bindings/go/repro/source_file.go b/cmd/scip/tests/reprolang/bindings/go/repro/source_file.go similarity index 100% rename from cmd/tests/reprolang/bindings/go/repro/source_file.go rename to cmd/scip/tests/reprolang/bindings/go/repro/source_file.go diff --git a/cmd/tests/reprolang/bindings/node/binding.cc b/cmd/scip/tests/reprolang/bindings/node/binding.cc similarity index 100% rename from cmd/tests/reprolang/bindings/node/binding.cc rename to cmd/scip/tests/reprolang/bindings/node/binding.cc diff --git a/cmd/tests/reprolang/bindings/node/index.js b/cmd/scip/tests/reprolang/bindings/node/index.js similarity index 100% rename from cmd/tests/reprolang/bindings/node/index.js rename to cmd/scip/tests/reprolang/bindings/node/index.js diff --git a/cmd/tests/reprolang/bindings/rust/build.rs b/cmd/scip/tests/reprolang/bindings/rust/build.rs similarity index 100% rename from cmd/tests/reprolang/bindings/rust/build.rs rename to cmd/scip/tests/reprolang/bindings/rust/build.rs diff --git a/cmd/tests/reprolang/bindings/rust/lib.rs b/cmd/scip/tests/reprolang/bindings/rust/lib.rs similarity index 100% rename from cmd/tests/reprolang/bindings/rust/lib.rs rename to cmd/scip/tests/reprolang/bindings/rust/lib.rs diff --git a/cmd/tests/reprolang/generate-tree-sitter-parser.sh b/cmd/scip/tests/reprolang/generate-tree-sitter-parser.sh similarity index 83% rename from cmd/tests/reprolang/generate-tree-sitter-parser.sh rename to cmd/scip/tests/reprolang/generate-tree-sitter-parser.sh index c903ea7b..909a2cf0 100755 --- a/cmd/tests/reprolang/generate-tree-sitter-parser.sh +++ b/cmd/scip/tests/reprolang/generate-tree-sitter-parser.sh @@ -4,4 +4,4 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) cd "$SCRIPT_DIR" yarn install ./node_modules/.bin/tree-sitter generate -yarn --cwd ../../.. run prettier +yarn --cwd ../../../.. run prettier diff --git a/cmd/tests/reprolang/grammar.js b/cmd/scip/tests/reprolang/grammar.js similarity index 100% rename from cmd/tests/reprolang/grammar.js rename to cmd/scip/tests/reprolang/grammar.js diff --git a/cmd/tests/reprolang/package.json b/cmd/scip/tests/reprolang/package.json similarity index 100% rename from cmd/tests/reprolang/package.json rename to cmd/scip/tests/reprolang/package.json diff --git a/cmd/tests/reprolang/src/binding.go b/cmd/scip/tests/reprolang/src/binding.go similarity index 100% rename from cmd/tests/reprolang/src/binding.go rename to cmd/scip/tests/reprolang/src/binding.go diff --git a/cmd/tests/reprolang/src/binding_test.go b/cmd/scip/tests/reprolang/src/binding_test.go similarity index 100% rename from cmd/tests/reprolang/src/binding_test.go rename to cmd/scip/tests/reprolang/src/binding_test.go diff --git a/cmd/tests/reprolang/src/grammar.json b/cmd/scip/tests/reprolang/src/grammar.json similarity index 100% rename from cmd/tests/reprolang/src/grammar.json rename to cmd/scip/tests/reprolang/src/grammar.json diff --git a/cmd/tests/reprolang/src/node-types.json b/cmd/scip/tests/reprolang/src/node-types.json similarity index 100% rename from cmd/tests/reprolang/src/node-types.json rename to cmd/scip/tests/reprolang/src/node-types.json diff --git a/cmd/tests/reprolang/src/parser.c b/cmd/scip/tests/reprolang/src/parser.c similarity index 100% rename from cmd/tests/reprolang/src/parser.c rename to cmd/scip/tests/reprolang/src/parser.c diff --git a/cmd/tests/reprolang/src/tree_sitter/parser.h b/cmd/scip/tests/reprolang/src/tree_sitter/parser.h similarity index 100% rename from cmd/tests/reprolang/src/tree_sitter/parser.h rename to cmd/scip/tests/reprolang/src/tree_sitter/parser.h diff --git a/cmd/tests/reprolang/src/workaround.go b/cmd/scip/tests/reprolang/src/workaround.go similarity index 100% rename from cmd/tests/reprolang/src/workaround.go rename to cmd/scip/tests/reprolang/src/workaround.go diff --git a/cmd/tests/snapshots/input/cyclic-reference/cycle1.repro b/cmd/scip/tests/snapshots/input/cyclic-reference/cycle1.repro similarity index 100% rename from cmd/tests/snapshots/input/cyclic-reference/cycle1.repro rename to cmd/scip/tests/snapshots/input/cyclic-reference/cycle1.repro diff --git a/cmd/tests/snapshots/input/cyclic-reference/cycle2.repro b/cmd/scip/tests/snapshots/input/cyclic-reference/cycle2.repro similarity index 100% rename from cmd/tests/snapshots/input/cyclic-reference/cycle2.repro rename to cmd/scip/tests/snapshots/input/cyclic-reference/cycle2.repro diff --git a/cmd/tests/snapshots/input/duplicates/duplicate.repro b/cmd/scip/tests/snapshots/input/duplicates/duplicate.repro similarity index 100% rename from cmd/tests/snapshots/input/duplicates/duplicate.repro rename to cmd/scip/tests/snapshots/input/duplicates/duplicate.repro diff --git a/cmd/tests/snapshots/input/global-cross-repo/reference.repro b/cmd/scip/tests/snapshots/input/global-cross-repo/reference.repro similarity index 100% rename from cmd/tests/snapshots/input/global-cross-repo/reference.repro rename to cmd/scip/tests/snapshots/input/global-cross-repo/reference.repro diff --git a/cmd/tests/snapshots/input/implementation-cross-repo/bird.repro b/cmd/scip/tests/snapshots/input/implementation-cross-repo/bird.repro similarity index 100% rename from cmd/tests/snapshots/input/implementation-cross-repo/bird.repro rename to cmd/scip/tests/snapshots/input/implementation-cross-repo/bird.repro diff --git a/cmd/tests/snapshots/input/implementation/animal.repro b/cmd/scip/tests/snapshots/input/implementation/animal.repro similarity index 100% rename from cmd/tests/snapshots/input/implementation/animal.repro rename to cmd/scip/tests/snapshots/input/implementation/animal.repro diff --git a/cmd/tests/snapshots/input/local-document/local1.repro b/cmd/scip/tests/snapshots/input/local-document/local1.repro similarity index 100% rename from cmd/tests/snapshots/input/local-document/local1.repro rename to cmd/scip/tests/snapshots/input/local-document/local1.repro diff --git a/cmd/tests/snapshots/input/local-document/local2.repro b/cmd/scip/tests/snapshots/input/local-document/local2.repro similarity index 100% rename from cmd/tests/snapshots/input/local-document/local2.repro rename to cmd/scip/tests/snapshots/input/local-document/local2.repro diff --git a/cmd/tests/snapshots/input/missing-symbol-information/globals.repro b/cmd/scip/tests/snapshots/input/missing-symbol-information/globals.repro similarity index 100% rename from cmd/tests/snapshots/input/missing-symbol-information/globals.repro rename to cmd/scip/tests/snapshots/input/missing-symbol-information/globals.repro diff --git a/cmd/tests/snapshots/input/missing-symbol-information/locals.repro b/cmd/scip/tests/snapshots/input/missing-symbol-information/locals.repro similarity index 100% rename from cmd/tests/snapshots/input/missing-symbol-information/locals.repro rename to cmd/scip/tests/snapshots/input/missing-symbol-information/locals.repro diff --git a/cmd/tests/snapshots/input/relationships/defined_by.repro b/cmd/scip/tests/snapshots/input/relationships/defined_by.repro similarity index 100% rename from cmd/tests/snapshots/input/relationships/defined_by.repro rename to cmd/scip/tests/snapshots/input/relationships/defined_by.repro diff --git a/cmd/tests/snapshots/input/relationships/mixed.repro b/cmd/scip/tests/snapshots/input/relationships/mixed.repro similarity index 100% rename from cmd/tests/snapshots/input/relationships/mixed.repro rename to cmd/scip/tests/snapshots/input/relationships/mixed.repro diff --git a/cmd/tests/snapshots/input/relationships/references.repro b/cmd/scip/tests/snapshots/input/relationships/references.repro similarity index 100% rename from cmd/tests/snapshots/input/relationships/references.repro rename to cmd/scip/tests/snapshots/input/relationships/references.repro diff --git a/cmd/tests/snapshots/input/relationships/type_defines.repro b/cmd/scip/tests/snapshots/input/relationships/type_defines.repro similarity index 100% rename from cmd/tests/snapshots/input/relationships/type_defines.repro rename to cmd/scip/tests/snapshots/input/relationships/type_defines.repro diff --git a/cmd/tests/snapshots/output/cyclic-reference/cycle1.repro b/cmd/scip/tests/snapshots/output/cyclic-reference/cycle1.repro similarity index 100% rename from cmd/tests/snapshots/output/cyclic-reference/cycle1.repro rename to cmd/scip/tests/snapshots/output/cyclic-reference/cycle1.repro diff --git a/cmd/tests/snapshots/output/cyclic-reference/cycle2.repro b/cmd/scip/tests/snapshots/output/cyclic-reference/cycle2.repro similarity index 100% rename from cmd/tests/snapshots/output/cyclic-reference/cycle2.repro rename to cmd/scip/tests/snapshots/output/cyclic-reference/cycle2.repro diff --git a/cmd/tests/snapshots/output/cyclic-reference/dump.lsif b/cmd/scip/tests/snapshots/output/cyclic-reference/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/cyclic-reference/dump.lsif rename to cmd/scip/tests/snapshots/output/cyclic-reference/dump.lsif diff --git a/cmd/tests/snapshots/output/duplicates/dump.lsif b/cmd/scip/tests/snapshots/output/duplicates/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/duplicates/dump.lsif rename to cmd/scip/tests/snapshots/output/duplicates/dump.lsif diff --git a/cmd/tests/snapshots/output/duplicates/duplicate.repro b/cmd/scip/tests/snapshots/output/duplicates/duplicate.repro similarity index 100% rename from cmd/tests/snapshots/output/duplicates/duplicate.repro rename to cmd/scip/tests/snapshots/output/duplicates/duplicate.repro diff --git a/cmd/tests/snapshots/output/global-cross-repo/dump.lsif b/cmd/scip/tests/snapshots/output/global-cross-repo/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/global-cross-repo/dump.lsif rename to cmd/scip/tests/snapshots/output/global-cross-repo/dump.lsif diff --git a/cmd/tests/snapshots/output/global-cross-repo/reference.repro b/cmd/scip/tests/snapshots/output/global-cross-repo/reference.repro similarity index 100% rename from cmd/tests/snapshots/output/global-cross-repo/reference.repro rename to cmd/scip/tests/snapshots/output/global-cross-repo/reference.repro diff --git a/cmd/tests/snapshots/output/implementation-cross-repo/bird.repro b/cmd/scip/tests/snapshots/output/implementation-cross-repo/bird.repro similarity index 100% rename from cmd/tests/snapshots/output/implementation-cross-repo/bird.repro rename to cmd/scip/tests/snapshots/output/implementation-cross-repo/bird.repro diff --git a/cmd/tests/snapshots/output/implementation-cross-repo/dump.lsif b/cmd/scip/tests/snapshots/output/implementation-cross-repo/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/implementation-cross-repo/dump.lsif rename to cmd/scip/tests/snapshots/output/implementation-cross-repo/dump.lsif diff --git a/cmd/tests/snapshots/output/implementation/animal.repro b/cmd/scip/tests/snapshots/output/implementation/animal.repro similarity index 100% rename from cmd/tests/snapshots/output/implementation/animal.repro rename to cmd/scip/tests/snapshots/output/implementation/animal.repro diff --git a/cmd/tests/snapshots/output/implementation/dump.lsif b/cmd/scip/tests/snapshots/output/implementation/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/implementation/dump.lsif rename to cmd/scip/tests/snapshots/output/implementation/dump.lsif diff --git a/cmd/tests/snapshots/output/local-document/dump.lsif b/cmd/scip/tests/snapshots/output/local-document/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/local-document/dump.lsif rename to cmd/scip/tests/snapshots/output/local-document/dump.lsif diff --git a/cmd/tests/snapshots/output/local-document/local1.repro b/cmd/scip/tests/snapshots/output/local-document/local1.repro similarity index 100% rename from cmd/tests/snapshots/output/local-document/local1.repro rename to cmd/scip/tests/snapshots/output/local-document/local1.repro diff --git a/cmd/tests/snapshots/output/local-document/local2.repro b/cmd/scip/tests/snapshots/output/local-document/local2.repro similarity index 100% rename from cmd/tests/snapshots/output/local-document/local2.repro rename to cmd/scip/tests/snapshots/output/local-document/local2.repro diff --git a/cmd/tests/snapshots/output/missing-symbol-information/dump.lsif b/cmd/scip/tests/snapshots/output/missing-symbol-information/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/missing-symbol-information/dump.lsif rename to cmd/scip/tests/snapshots/output/missing-symbol-information/dump.lsif diff --git a/cmd/tests/snapshots/output/missing-symbol-information/globals.repro b/cmd/scip/tests/snapshots/output/missing-symbol-information/globals.repro similarity index 100% rename from cmd/tests/snapshots/output/missing-symbol-information/globals.repro rename to cmd/scip/tests/snapshots/output/missing-symbol-information/globals.repro diff --git a/cmd/tests/snapshots/output/missing-symbol-information/locals.repro b/cmd/scip/tests/snapshots/output/missing-symbol-information/locals.repro similarity index 100% rename from cmd/tests/snapshots/output/missing-symbol-information/locals.repro rename to cmd/scip/tests/snapshots/output/missing-symbol-information/locals.repro diff --git a/cmd/tests/snapshots/output/relationships/defined_by.repro b/cmd/scip/tests/snapshots/output/relationships/defined_by.repro similarity index 100% rename from cmd/tests/snapshots/output/relationships/defined_by.repro rename to cmd/scip/tests/snapshots/output/relationships/defined_by.repro diff --git a/cmd/tests/snapshots/output/relationships/dump.lsif b/cmd/scip/tests/snapshots/output/relationships/dump.lsif similarity index 100% rename from cmd/tests/snapshots/output/relationships/dump.lsif rename to cmd/scip/tests/snapshots/output/relationships/dump.lsif diff --git a/cmd/tests/snapshots/output/relationships/mixed.repro b/cmd/scip/tests/snapshots/output/relationships/mixed.repro similarity index 100% rename from cmd/tests/snapshots/output/relationships/mixed.repro rename to cmd/scip/tests/snapshots/output/relationships/mixed.repro diff --git a/cmd/tests/snapshots/output/relationships/references.repro b/cmd/scip/tests/snapshots/output/relationships/references.repro similarity index 100% rename from cmd/tests/snapshots/output/relationships/references.repro rename to cmd/scip/tests/snapshots/output/relationships/references.repro diff --git a/cmd/tests/snapshots/output/relationships/type_defines.repro b/cmd/scip/tests/snapshots/output/relationships/type_defines.repro similarity index 100% rename from cmd/tests/snapshots/output/relationships/type_defines.repro rename to cmd/scip/tests/snapshots/output/relationships/type_defines.repro diff --git a/cmd/version.txt b/cmd/scip/version.txt similarity index 100% rename from cmd/version.txt rename to cmd/scip/version.txt diff --git a/dev/publish-release.sh b/dev/publish-release.sh index 5831f812..fe066d96 100755 --- a/dev/publish-release.sh +++ b/dev/publish-release.sh @@ -15,8 +15,8 @@ if ! grep -q "## v$NEW_VERSION" CHANGELOG.md; then exit 1 fi -if ! grep -q "$NEW_VERSION" cmd/version.txt; then - echo "error: SCIP version in cmd/version.txt doesn't match NEW_VERSION=$NEW_VERSION" +if ! grep -q "$NEW_VERSION" cmd/scip/version.txt; then + echo "error: SCIP version in cmd/scip/version.txt doesn't match NEW_VERSION=$NEW_VERSION" exit 1 fi diff --git a/package.json b/package.json index f1af68b8..e268b382 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "workspaces": { "packages": [ - "cmd/tests/reprolang", + "cmd/scip/tests/reprolang", "bindings/typescript" ] },