*: mv scripts _scripts

Instead of selectively excluding this directory, hide it from the go
tooling by applying the "_" prefix.
This commit is contained in:
Derek Parker 2020-03-28 11:18:55 -07:00 committed by Alessandro Arzilli
parent 5d109cb197
commit 85c34e47ee
15 changed files with 31 additions and 31 deletions

@ -2,7 +2,7 @@ version = 1
test_patterns = ["**/*_test.go"]
exclude_patterns = ["vendor", "_fixtures", "scripts"]
exclude_patterns = ["vendor", "_fixtures", "_scripts"]
[[analyzers]]
name = "go"

@ -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

@ -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")

@ -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)

@ -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) {

@ -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

@ -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:

@ -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"

@ -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