-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (31 loc) · 1.01 KB
/
Makefile
File metadata and controls
40 lines (31 loc) · 1.01 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
GOLANGCI_VERSION ?= 1.46.2
GOIMPORTS_VERSION ?= v0.1.12
.PHONY: default
default: lint test
.PHONY: test
test:
@echo "==> Executing tests..."
@go test -test.v ./... -race -covermode=atomic -coverprofile=cover.out && \
go tool cover -func=cover.out && rm cover.out
.PHONY: lint
lint: tools/golangci-lint
@echo "==> Running golangci-lint..."
@tools/golangci-lint run
.PHONY: goimports
goimports: tools/goimports
@echo "==> Running goimports..."
@tools/goimports -w $(GOFMT_FILES)
.PHONY: calculate-next-semver
calculate-next-semver:
@bash -e -o pipefail -c '(source ./scripts/calculate-next-version.sh && echo $${FULL_TAG}) | tail -n 1'
###########################
# Tools targets
###########################
.PHONY: tools/golangci-lint
tools/golangci-lint:
@echo "==> Installing golangci-lint..."
@./scripts/install-golangci-lint.sh $(GOLANGCI_VERSION)
.PHONY: tools/goimports
tools/goimports:
@echo "==> Installing goimports..."
@GOBIN=$$(pwd)/tools/ go install golang.org/x/tools/cmd/goimports@$(GOIMPORTS_VERSION)