-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (28 loc) · 1004 Bytes
/
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
.DEFAULT_GOAL := help
GOLANGCI_LINT_VERSION ?= v1.19.1
.PHONY: help
help:
@grep -E '^[a-zA-Z-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "[32m%-12s[0m %s\n", $$1, $$2}'
.PHONY: build
build: ## build collections-gen
go build -ldflags "-s -w"
.PHONY: install
install: build ## install collections-gen
cp collections-gen $(GOPATH)/bin/
.PHONY: test
test: ## run tests
go test -race -tags="$(TAGS)" $$(go list ./... | grep -v /vendor/)
.PHONY: generate
generate: install ## run go generate
go generate $$(go list ./... | grep -v /vendor/)
.PHONY: verify-codegen
verify-codegen: ## verify generated code is uptodate
scripts/verify-codegen
.PHONY: coverage
coverage: ## generate code coverage
scripts/coverage
.PHONY: lint
lint: ## run golangci-lint
command -v golangci-lint > /dev/null 2>&1 || \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin $(GOLANGCI_LINT_VERSION)
golangci-lint run