Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (39 loc) · 1.54 KB
/
Copy pathMakefile
File metadata and controls
54 lines (39 loc) · 1.54 KB
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
#!/usr/bin/make -f
VERSION = $(shell git rev-parse HEAD)
.PHONY: help
help:
@echo
@echo "Commands"
@echo "========"
@echo
@sed -n '/^[a-zA-Z0-9_-]*:/s/:.*//p' < Makefile | grep -v -E 'default|help.*' | sort
.PHONY: build
build:
CGO_ENABLED=1 go build ./...
.PHONY: test
test: test-unit
.PHONY: test-unit
test-unit:
@VERSION=$(VERSION) go test -mod=readonly ./...
.PHONY: test-race
test-race:
@VERSION=$(VERSION) go test -mod=readonly --race ./...
.PHONY: build-linux-static
build-linux-static:
$(MAKE) -C examples/wasmd build-linux-static
###############################################################################
### Linting ###
###############################################################################
.PHONY: format-tools
format-tools:
go install mvdan.cc/gofumpt@v0.3.1
go install github.com/client9/misspell/cmd/misspell@v0.3.4
.PHONY: lint
lint: format-tools
golangci-lint run --tests=false
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofumpt -d -s
.PHONY: format
format: format-tools
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs gofumpt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -path "./client/lcd/statik/statik.go" | xargs goimports -w -local github.com/alpe/cosmos-tracing