-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 829 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
38
GOBIN := $(GOPATH)/bin
PATH := $(GOBIN):$(PATH)
GOLANGCI_VERSION=v1.57.2
TOOLS += golang.org/x/tools/cmd/goimports
.PHONY: tools
tools: $(TOOLS) golangci_lint
.PHONY: $(TOOLS)
$(TOOLS): %:
cd /tmp && GOBIN=$(GOBIN) go get -u $*
.PHONY: golangci_lint
golangci_lint:
cd /tmp && wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s ${GOLANGCI_VERSION}
.PHONY: lint
lint:
$(info Running Go code checkers and linters)
golangci-lint --version
golangci-lint run -E gofumpt --timeout 5m --verbose ./...
.PHONY: fmt
fmt:
golangci-lint run -E gofumpt --fix ./...
test:
go test --race -v ./...
test_e2e:
go test --race -tags=e2e -v ./...
.PHONY: display_coverage
display_coverage:
go test --race --cover -coverprofile=coverage.out ./...
go tool cover -html=coverage.out