-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
59 lines (44 loc) · 2.19 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
export GO111MODULE = on
###############################################################################
### All ###
###############################################################################
all: lint test-unit
###############################################################################
### Tools & Dependencies ###
###############################################################################
tools:
@go install github.com/client9/misspell/cmd/misspell
@go install golang.org/x/tools/cmd/goimports
go-mod-cache: go.sum
@echo "--> Download go modules to local cache"
@go mod download
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify
@go mod tidy
clean:
rm -rf $(BUILDDIR)/
.PHONY: clean
###############################################################################
### Linting ###
###############################################################################
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint
lint:
@echo "--> Running linter"
@go run $(golangci_lint_cmd) run --timeout=10m
lint-fix:
@echo "--> Running linter"
@go run $(golangci_lint_cmd) run --fix --out-format=tab --issues-exit-code=0
.PHONY: lint lint-fix
format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -path "./venv" | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -path "./venv" | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' -not -path "./venv" | xargs goimports -w -local github.com/desmos-labs/cosmos-go-wallet
.PHONY: format
###############################################################################
### Tests & Simulation ###
###############################################################################
test-unit:
@echo "Executing unit tests..."
@go test -mod=readonly -v -coverprofile coverage.txt ./...
.PHONY: test-unit