mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
Makefile: improve make commands (#1576)
This commit is contained in:
parent
11e82672fe
commit
92fdd347cf
2 changed files with 17 additions and 17 deletions
12
Makefile
12
Makefile
|
|
@ -53,13 +53,13 @@ quick-test: all
|
||||||
lint: ## Run linters.
|
lint: ## Run linters.
|
||||||
$(GORUN) build/ci.go lint
|
$(GORUN) build/ci.go lint
|
||||||
|
|
||||||
#? check_tidy: Verify go.mod and go.sum by 'go mod tidy'
|
#? tidy: Verify go.mod and go.sum by 'go mod tidy'
|
||||||
check_tidy: ## Run 'go mod tidy'.
|
tidy: ## Run 'go mod tidy'.
|
||||||
$(GORUN) build/ci.go check_tidy
|
$(GORUN) build/ci.go tidy
|
||||||
|
|
||||||
#? check_generate: Verify everything is 'go generate'-ed
|
#? generate: Verify everything is 'go generate'-ed
|
||||||
check_generate: ## Run 'go generate ./...'.
|
generate: ## Run 'go generate ./...'.
|
||||||
$(GORUN) build/ci.go check_generate
|
$(GORUN) build/ci.go generate
|
||||||
|
|
||||||
#? fmt: Ensure consistent code formatting.
|
#? fmt: Ensure consistent code formatting.
|
||||||
fmt:
|
fmt:
|
||||||
|
|
|
||||||
22
build/ci.go
22
build/ci.go
|
|
@ -24,9 +24,9 @@ Usage: go run build/ci.go <command> <command flags/arguments>
|
||||||
|
|
||||||
Available commands are:
|
Available commands are:
|
||||||
|
|
||||||
lint -- runs certain pre-selected linters
|
lint -- runs certain pre-selected linters
|
||||||
check_tidy -- verifies that everything is 'go mod tidy'-ed
|
tidy -- verifies that everything is 'go mod tidy'-ed
|
||||||
check_generate -- verifies that everything is 'go generate'-ed
|
generate -- verifies that everything is 'go generate'-ed
|
||||||
|
|
||||||
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
|
install [ -arch architecture ] [ -cc compiler ] [ packages... ] -- builds packages and executables
|
||||||
test [ -coverage ] [ packages... ] -- runs the tests
|
test [ -coverage ] [ packages... ] -- runs the tests
|
||||||
|
|
@ -93,10 +93,10 @@ func main() {
|
||||||
doTest(os.Args[2:])
|
doTest(os.Args[2:])
|
||||||
case "lint":
|
case "lint":
|
||||||
doLint(os.Args[2:])
|
doLint(os.Args[2:])
|
||||||
case "check_tidy":
|
case "tidy":
|
||||||
doCheckTidy()
|
doTidy()
|
||||||
case "check_generate":
|
case "generate":
|
||||||
doCheckGenerate()
|
doGenerate()
|
||||||
case "xgo":
|
case "xgo":
|
||||||
doXgo(os.Args[2:])
|
doXgo(os.Args[2:])
|
||||||
default:
|
default:
|
||||||
|
|
@ -254,8 +254,8 @@ func doTest(cmdline []string) {
|
||||||
build.MustRun(gotest)
|
build.MustRun(gotest)
|
||||||
}
|
}
|
||||||
|
|
||||||
// doCheckTidy assets that the Go modules files are tidied already.
|
// doTidy assets that the Go modules files are tidied already.
|
||||||
func doCheckTidy() {
|
func doTidy() {
|
||||||
targets := []string{"go.mod", "go.sum"}
|
targets := []string{"go.mod", "go.sum"}
|
||||||
|
|
||||||
hashes, err := build.HashFiles(targets)
|
hashes, err := build.HashFiles(targets)
|
||||||
|
|
@ -274,9 +274,9 @@ func doCheckTidy() {
|
||||||
fmt.Println("No untidy module files detected.")
|
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.
|
// any mutations in the source file tree.
|
||||||
func doCheckGenerate() {
|
func doGenerate() {
|
||||||
var (
|
var (
|
||||||
cachedir = flag.String("cachedir", "./build/cache", "directory for caching binaries.")
|
cachedir = flag.String("cachedir", "./build/cache", "directory for caching binaries.")
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue