-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (37 loc) · 949 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
39
40
41
42
43
44
45
46
.PHONY: build-air
build-air:
go build -modfile=tools/go.mod -o bin/air github.com/cosmtrek/air
.PHONY: build-gofumpt
build-gofumpt:
go build -modfile=tools/go.mod -o bin/gofumpt mvdan.cc/gofumpt
.PHONY: build-golangci
build-golangci:
go build -modfile=tools/go.mod -o bin/golangci-lint github.com/golangci/golangci-lint/cmd/golangci-lint
.PHONY: init
init:
make build-gofumpt
make build-golangci
make build-air
.PHONY: check
check:
if [ ! -f "bin/golangci-lint" ]; then make build-golangci; fi
bin/golangci-lint run
FILES = $(shell find . -type f -name '*.go')
.PHONY: format
format:
if [ ! -f "bin/gofumpt" ]; then make build-gofumpt; fi
bin/gofumpt -w $(FILES)
.PHONY: test
test:
go test -cover -coverprofile=coverage.out ./sampler/...
go tool cover -html=coverage.out -o coverage.html
.PHONY: air
air:
if [ ! -f "bin/air" ]; then make build-air; fi
bin/air
.PHONY: all
all:
go mod tidy
make check
make format
make test