-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
59 lines (42 loc) · 2.21 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
LOADTEST_BIN=./build/loadtest
GO_FILES=$(shell find . -name '*.go' -type f -not -path "./vendor/*")
GO_DEPS=go.mod go.sum
###############################################################################
### Builds ###
###############################################################################
.PHONY: tidy deps
tidy:
go mod tidy
deps:
go env
go mod download
${LOADTEST_BIN}: ${GO_FILES} ${GO_DEPS}
@echo "Building load test binary..."
@mkdir -p ./build
go build -o ./build/ github.com/skip-mev/catalyst/cmd/loadtest
.PHONY: build
build: ${LOADTEST_BIN}
###############################################################################
### Formatting ###
###############################################################################
format:
@find . -name '*.go' -type f -not -path "*.git*" -not -path "*/mocks/*" -not -name '*.pb.go' -not -name '*.pulsar.go' -not -name '*.gw.go' | xargs go run mvdan.cc/gofumpt -w .
@find . -name '*.go' -type f -not -path "*.git*" -not -path "*/mocks/*" -not -name '*.pb.go' -not -name '*.pulsar.go' -not -name '*.gw.go' | xargs go run github.com/client9/misspell/cmd/misspell -w
@find . -name '*.go' -type f -not -path "*.git*" -not -path "/*mocks/*" -not -name '*.pb.go' -not -name '*.pulsar.go' -not -name '*.gw.go' | xargs go run golang.org/x/tools/cmd/goimports -w -local github.com/skip-mev/catalyst
.PHONY: format
###############################################################################
### Linting ###
###############################################################################
lint: tidy
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --out-format=tab
lint-fix: tidy
@echo "--> Running linter"
@go run github.com/golangci/golangci-lint/cmd/golangci-lint run --fix --out-format=tab --issues-exit-code=0
lint-markdown: tidy
@echo "--> Running markdown linter"
@markdownlint **/*.md
govulncheck: tidy
@echo "--> Running govulncheck"
@go run golang.org/x/vuln/cmd/govulncheck -test ./...
.PHONY: lint lint-fix lint-markdown govulncheck