mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +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.
|
||||
$(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:
|
||||
|
|
|
|||
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:
|
||||
|
||||
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.")
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue