diff --git a/Makefile b/Makefile index 43d74d370a..67060859ca 100644 --- a/Makefile +++ b/Makefile @@ -53,13 +53,13 @@ quick-test: all lint: ## Run linters. $(GORUN) build/ci.go lint -#? check_tidy: Verify go.mod and go.sum by 'go mod tidy' -check_tidy: ## Run 'go mod tidy'. - $(GORUN) build/ci.go check_tidy +#? tidy: Verify go.mod and go.sum by 'go mod tidy' +tidy: ## Run 'go mod tidy'. + $(GORUN) build/ci.go tidy -#? check_generate: Verify everything is 'go generate'-ed -check_generate: ## Run 'go generate ./...'. - $(GORUN) build/ci.go check_generate +#? generate: Verify everything is 'go generate'-ed +generate: ## Run 'go generate ./...'. + $(GORUN) build/ci.go generate #? fmt: Ensure consistent code formatting. fmt: diff --git a/build/ci.go b/build/ci.go index cacec49551..2d61d70a9b 100644 --- a/build/ci.go +++ b/build/ci.go @@ -24,9 +24,9 @@ Usage: go run build/ci.go Available commands are: - lint -- runs certain pre-selected linters - check_tidy -- verifies that everything is 'go mod tidy'-ed - check_generate -- verifies that everything is 'go generate'-ed + lint -- runs certain pre-selected linters + tidy -- verifies that everything is 'go mod tidy'-ed + generate -- verifies that everything is 'go generate'-ed install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables test [ -coverage ] [ packages... ] -- runs the tests @@ -93,10 +93,10 @@ func main() { doTest(os.Args[2:]) case "lint": doLint(os.Args[2:]) - case "check_tidy": - doCheckTidy() - case "check_generate": - doCheckGenerate() + case "tidy": + doTidy() + case "generate": + doGenerate() case "xgo": doXgo(os.Args[2:]) default: @@ -254,8 +254,8 @@ func doTest(cmdline []string) { build.MustRun(gotest) } -// doCheckTidy assets that the Go modules files are tidied already. -func doCheckTidy() { +// doTidy assets that the Go modules files are tidied already. +func doTidy() { targets := []string{"go.mod", "go.sum"} hashes, err := build.HashFiles(targets) @@ -274,9 +274,9 @@ func doCheckTidy() { fmt.Println("No untidy module files detected.") } -// doCheckGenerate ensures that re-generating generated files does not cause +// doGenerate ensures that re-generating generated files does not cause // any mutations in the source file tree. -func doCheckGenerate() { +func doGenerate() { var ( cachedir = flag.String("cachedir", "./build/cache", "directory for caching binaries.") )