forked from beatlabs/patron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (29 loc) · 1.25 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
37
38
39
40
41
42
DOCKER = docker
default: test
test: fmtcheck
go test ./... -cover -race -timeout 60s
testint: fmtcheck
go test ./... -race -cover -tags=integration -timeout 60s -count=1
cover: fmtcheck
go test ./... -coverpkg=./... -coverprofile=coverage.txt -tags=integration -covermode=atomic && \
go tool cover -func=coverage.txt && \
rm coverage.txt
coverci: fmtcheck
go test ./... -race -cover -mod=vendor -coverprofile=coverage.txt -covermode=atomic -tags=integration
fmt:
go fmt ./...
fmtcheck:
@sh -c "'$(CURDIR)/script/gofmtcheck.sh'"
lint: fmtcheck
$(DOCKER) run --env=GOFLAGS=-mod=vendor --rm -v $(CURDIR):/app -w /app golangci/golangci-lint:v1.28.1 golangci-lint run --enable golint,gofmt,gosec,unparam,goconst,prealloc,stylecheck,unconvert --exclude-use-default=false --deadline=5m --build-tags integration
deeplint: fmtcheck
golangci-lint run --enable-all --exclude-use-default=false -D dupl --build-tags integration
ci: fmtcheck lint coverci
modsync: fmtcheck
go mod tidy && \
go mod vendor
# disallow any parallelism (-j) for Make. This is necessary since some
# commands during the build process create temporary files that collide
# under parallel conditions.
.NOTPARALLEL:
.PHONY: default test testint cover coverci fmt fmtcheck lint deeplint ci modsync