diff --git a/.deepsource.toml b/.deepsource.toml index 8f810900..6889372d 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -2,7 +2,7 @@ version = 1 test_patterns = ["**/*_test.go"] -exclude_patterns = ["vendor", "_fixtures", "scripts"] +exclude_patterns = ["vendor", "_fixtures", "_scripts"] [[analyzers]] name = "go" diff --git a/Makefile b/Makefile index ae142f6d..813e0b30 100644 --- a/Makefile +++ b/Makefile @@ -1,30 +1,30 @@ .DEFAULT_GOAL=test check-cert: - @go run scripts/make.go check-cert + @go run _scripts/make.go check-cert build: - @go run scripts/make.go build + @go run _scripts/make.go build install: - @go run scripts/make.go install + @go run _scripts/make.go install uninstall: - @go run scripts/make.go uninstall + @go run _scripts/make.go uninstall test: vet - @go run scripts/make.go test + @go run _scripts/make.go test vet: - @go vet $$(go list ./... | grep -v scripts | grep -v native) + @go vet $$(go list ./... | grep -v native) test-proc-run: - @go run scripts/make.go test -s proc -r $(RUN) + @go run _scripts/make.go test -s proc -r $(RUN) test-integration-run: - @go run scripts/make.go test -s service/test -r $(RUN) + @go run _scripts/make.go test -s service/test -r $(RUN) vendor: - @go run scripts/make.go vendor + @go run _scripts/make.go vendor .PHONY: vendor test-integration-run test-proc-run test check-cert install build vet diff --git a/scripts/gen-cli-docs.go b/_scripts/gen-cli-docs.go similarity index 100% rename from scripts/gen-cli-docs.go rename to _scripts/gen-cli-docs.go diff --git a/scripts/gen-opcodes.go b/_scripts/gen-opcodes.go similarity index 100% rename from scripts/gen-opcodes.go rename to _scripts/gen-opcodes.go diff --git a/scripts/gen-starlark-bindings.go b/_scripts/gen-starlark-bindings.go similarity index 99% rename from scripts/gen-starlark-bindings.go rename to _scripts/gen-starlark-bindings.go index 30595691..91e0d069 100644 --- a/scripts/gen-starlark-bindings.go +++ b/_scripts/gen-starlark-bindings.go @@ -152,7 +152,7 @@ func removePackagePath(typePath string) string { func genMapping(bindings []binding) []byte { buf := bytes.NewBuffer([]byte{}) - fmt.Fprintf(buf, "// DO NOT EDIT: auto-generated using scripts/gen-starlark-bindings.go\n\n") + fmt.Fprintf(buf, "// DO NOT EDIT: auto-generated using _scripts/gen-starlark-bindings.go\n\n") fmt.Fprintf(buf, "package starbind\n\n") fmt.Fprintf(buf, "import ( \"go.starlark.net/starlark\" \n \"github.com/go-delve/delve/service/api\" \n \"github.com/go-delve/delve/service/rpc2\" \n \"fmt\" )\n\n") fmt.Fprintf(buf, "func (env *Env) starlarkPredeclare() starlark.StringDict {\n") diff --git a/scripts/gen-travis.go b/_scripts/gen-travis.go similarity index 100% rename from scripts/gen-travis.go rename to _scripts/gen-travis.go diff --git a/scripts/gen-usage-docs.go b/_scripts/gen-usage-docs.go similarity index 100% rename from scripts/gen-usage-docs.go rename to _scripts/gen-usage-docs.go diff --git a/scripts/gencert.sh b/_scripts/gencert.sh similarity index 100% rename from scripts/gencert.sh rename to _scripts/gencert.sh diff --git a/scripts/make.go b/_scripts/make.go similarity index 95% rename from scripts/make.go rename to _scripts/make.go index a57aa170..2e607c21 100644 --- a/scripts/make.go +++ b/_scripts/make.go @@ -72,13 +72,13 @@ func NewMakeCommands() *cobra.Command { Use the flags -s, -r and -b to specify which tests to run. Specifying nothing is equivalent to: - go run scripts/make.go test -s all -b default - go run scripts/make.go test -s basic -b lldb # if lldb-server is installed and Go < 1.14 - go run scripts/make.go test -s basic -b rr # if rr is installed + go run _scripts/make.go test -s all -b default + go run _scripts/make.go test -s basic -b lldb # if lldb-server is installed and Go < 1.14 + go run _scripts/make.go test -s basic -b rr # if rr is installed - go run scripts/make.go test -s basic -m pie # only on linux - go run scripts/make.go test -s core -m pie # only on linux - go run scripts/make.go test -s + go run _scripts/make.go test -s basic -m pie # only on linux + go run _scripts/make.go test -s core -m pie # only on linux + go run _scripts/make.go test -s `, Run: testCmd, } @@ -122,7 +122,7 @@ func checkCert() bool { return true } - x := exec.Command("scripts/gencert.sh") + x := exec.Command("_scripts/gencert.sh") x.Stdout = os.Stdout x.Stderr = os.Stderr x.Env = os.Environ() @@ -280,7 +280,7 @@ func testFlags() []string { testFlags = append(testFlags, "-timeout", "0") } if runtime.GOOS == "darwin" { - testFlags = append(testFlags, "-exec="+wd+"/scripts/testsign") + testFlags = append(testFlags, "-exec="+wd+"/_scripts/testsign") } return testFlags } @@ -420,7 +420,7 @@ func allPackages() []string { r := []string{} for _, dir := range strings.Split(getoutput("go", "list", "-mod=vendor", "./..."), "\n") { dir = strings.TrimSpace(dir) - if dir == "" || strings.Contains(dir, "/vendor/") || strings.Contains(dir, "/scripts") { + if dir == "" || strings.Contains(dir, "/vendor/") || strings.Contains(dir, "/_scripts") { continue } r = append(r, dir) diff --git a/scripts/testsign b/_scripts/testsign similarity index 100% rename from scripts/testsign rename to _scripts/testsign diff --git a/cmd/dlv/dlv_test.go b/cmd/dlv/dlv_test.go index 372e320d..1c393a23 100644 --- a/cmd/dlv/dlv_test.go +++ b/cmd/dlv/dlv_test.go @@ -76,7 +76,7 @@ func TestBuild(t *testing.T) { const listenAddr = "127.0.0.1:40573" var err error - cmd := exec.Command("go", "run", "scripts/make.go", "build") + cmd := exec.Command("go", "run", "_scripts/make.go", "build") cmd.Dir = projectRoot() out, err := cmd.CombinedOutput() if err != nil { @@ -285,20 +285,20 @@ func TestGeneratedDoc(t *testing.T) { var generatedBuf bytes.Buffer commands := terminal.DebugCommands(nil) commands.WriteMarkdown(&generatedBuf) - checkAutogenDoc(t, "Documentation/cli/README.md", "scripts/gen-cli-docs.go", generatedBuf.Bytes()) + checkAutogenDoc(t, "Documentation/cli/README.md", "_scripts/gen-cli-docs.go", generatedBuf.Bytes()) // Checks gen-usage-docs.go tempDir, err := ioutil.TempDir(os.TempDir(), "test-gen-doc") assertNoError(err, t, "TempDir") defer protest.SafeRemoveAll(tempDir) - cmd := exec.Command("go", "run", "scripts/gen-usage-docs.go", tempDir) + cmd := exec.Command("go", "run", "_scripts/gen-usage-docs.go", tempDir) cmd.Dir = projectRoot() cmd.Run() entries, err := ioutil.ReadDir(tempDir) assertNoError(err, t, "ReadDir") for _, doc := range entries { docFilename := "Documentation/usage/" + doc.Name() - checkAutogenDoc(t, docFilename, "scripts/gen-usage-docs.go", slurpFile(t, tempDir+"/"+doc.Name())) + checkAutogenDoc(t, docFilename, "_scripts/gen-usage-docs.go", slurpFile(t, tempDir+"/"+doc.Name())) } runScript := func(args ...string) []byte { @@ -313,8 +313,8 @@ func TestGeneratedDoc(t *testing.T) { return out } - checkAutogenDoc(t, "pkg/terminal/starbind/starlark_mapping.go", "'go generate' inside pkg/terminal/starbind", runScript("scripts/gen-starlark-bindings.go", "go", "-")) - checkAutogenDoc(t, "Documentation/cli/starlark.md", "'go generate' inside pkg/terminal/starbind", runScript("scripts/gen-starlark-bindings.go", "doc/dummy", "Documentation/cli/starlark.md")) + checkAutogenDoc(t, "pkg/terminal/starbind/starlark_mapping.go", "'go generate' inside pkg/terminal/starbind", runScript("_scripts/gen-starlark-bindings.go", "go", "-")) + checkAutogenDoc(t, "Documentation/cli/starlark.md", "'go generate' inside pkg/terminal/starbind", runScript("_scripts/gen-starlark-bindings.go", "doc/dummy", "Documentation/cli/starlark.md")) } func TestExitInInit(t *testing.T) { diff --git a/pkg/dwarf/op/op.go b/pkg/dwarf/op/op.go index 0690e609..5edcd828 100644 --- a/pkg/dwarf/op/op.go +++ b/pkg/dwarf/op/op.go @@ -14,7 +14,7 @@ import ( // See ./opcodes.go for a full list. type Opcode byte -//go:generate go run ../../../scripts/gen-opcodes.go opcodes.table opcodes.go +//go:generate go run ../../../_scripts/gen-opcodes.go opcodes.table opcodes.go type stackfn func(Opcode, *context) error diff --git a/pkg/dwarf/op/opcodes.table b/pkg/dwarf/op/opcodes.table index 4d6c17bc..f1dadc07 100644 --- a/pkg/dwarf/op/opcodes.table +++ b/pkg/dwarf/op/opcodes.table @@ -1,4 +1,4 @@ -// This file is used by scripts/gen-opcodes.go to generate +// This file is used by _scripts/gen-opcodes.go to generate // pkg/dwarf/op/opcodes.go // Lines starting with // are comments and will be discarded. // Non empty lines contain the following tab separated fields: diff --git a/pkg/terminal/starbind/starlark.go b/pkg/terminal/starbind/starlark.go index d6a53e2c..f620f6f7 100644 --- a/pkg/terminal/starbind/starlark.go +++ b/pkg/terminal/starbind/starlark.go @@ -15,8 +15,8 @@ import ( "github.com/go-delve/delve/service/api" ) -//go:generate go run ../../../scripts/gen-starlark-bindings.go go ./starlark_mapping.go -//go:generate go run ../../../scripts/gen-starlark-bindings.go doc ../../../Documentation/cli/starlark.md +//go:generate go run ../../../_scripts/gen-starlark-bindings.go go ./starlark_mapping.go +//go:generate go run ../../../_scripts/gen-starlark-bindings.go doc ../../../Documentation/cli/starlark.md const ( dlvCommandBuiltinName = "dlv_command" diff --git a/pkg/terminal/starbind/starlark_mapping.go b/pkg/terminal/starbind/starlark_mapping.go index fd18029a..5374d88d 100644 --- a/pkg/terminal/starbind/starlark_mapping.go +++ b/pkg/terminal/starbind/starlark_mapping.go @@ -1,4 +1,4 @@ -// DO NOT EDIT: auto-generated using scripts/gen-starlark-bindings.go +// DO NOT EDIT: auto-generated using _scripts/gen-starlark-bindings.go package starbind