-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
36 lines (28 loc) · 1.36 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
DEFAULT_GOAL := help
.PHONY : check lint install-linters dep
OPTS?=GO111MODULE=on
TEST_OPTS?=-race -tags no_ci -cover -timeout=10m
check: lint test ## Run linters and tests
lint: ## Run linters. Use make install-linters first
${OPTS} golangci-lint run -c .golangci.yml ./...
# The govet version in golangci-lint is out of date and has spurious warnings, run it separately
${OPTS} go vet -all ./...
vendorcheck: ## Run vendorcheck
GO111MODULE=off vendorcheck ./...
test: ## Run tests
-go clean -testcache &>/dev/null
${OPTS} go test ${TEST_OPTS} ./...
install-linters: ## Install linters
- VERSION=1.23.8 ./ci_scripts/install-golangci-lint.sh
# GO111MODULE=off go get -u github.com/FiloSottile/vendorcheck
# For some reason this install method is not recommended, see https://github.com/golangci/golangci-lint#install
# However, they suggest `curl ... | bash` which we should not do
# ${OPTS} go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
${OPTS} go get -u golang.org/x/tools/cmd/goimports
format: ## Formats the code. Must have goimports installed (use make install-linters).
${OPTS} goimports -w -local github.com/SkycoinProject/dmsg-http .
dep: ## Sorts dependencies
${OPTS} go mod download
${OPTS} go mod tidy -v
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'