This repository has been archived by the owner on Apr 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
54 lines (44 loc) · 1.58 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
43
44
45
46
47
48
49
50
51
52
53
54
###################### //S/M Makefile ######################
#
# Edit this file with care, as it is also being used by our CI/CD Pipeline
# For usage information check README.md
#
# Parts of this makefile are based upon github.com/kolide/kit
#
PATH := $(GOPATH)/bin:$(PATH)
-include .env
# install required tools and dependencies
deps:
go get -u golang.org/x/tools/cmd/goimports
go get -u github.com/golang/lint/golint
go get -u github.com/kisielk/errcheck
go get -u github.com/golang/dep/cmd/dep
go get -u github.com/bborbe/docker-utils/cmd/docker-remote-tag-exists
go get -u github.com/haya14busa/goverage
go get -u github.com/schrej/godacov
go get -u github.com/maxbrunsfeld/counterfeiter
# test entire repo
test:
@go test -cover -race $(shell go list ./... | grep -v /vendor/)
# format entire repo (excluding vendor)
format:
find . -type f -name '*.go' -not -path './vendor/*' -exec gofmt -w "{}" +
find . -type f -name '*.go' -not -path './vendor/*' -exec goimports -w "{}" +
# go quality checks
check: format lint vet
# vet entire repo (excluding vendor)
vet:
@go vet $(shell go list ./... | grep -v /vendor/)
# lint entire repo (excluding vendor)
lint:
golint -min_confidence 1 $(shell go list ./... | grep -v /vendor/)
# errcheck entire repo (excluding vendor)
errcheck:
errcheck -ignore '(Close|Write)' $(shell go list ./... | grep -v /vendor/)
cover:
go get github.com/haya14busa/goverage
go get github.com/schrej/godacov
goverage -v -coverprofile=coverage.out $(shell go list ./... | grep -v /vendor/)
generate:
@go get github.com/maxbrunsfeld/counterfeiter
@go generate ./...