-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
74 lines (60 loc) · 1.75 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
dev_build_version=$(shell git describe --tags --always --dirty)
# TODO: run golint and errcheck, but only to catch *new* violations and
# decide whether to change code or not (e.g. we need to be able to whitelist
# violations already in the code). They can be useful to catch errors, but
# they are just too noisy to be a requirement for a CI -- we don't even *want*
# to fix some of the things they consider to be violations.
.PHONY: ci
ci: deps checkgofmt vet staticcheck ineffassign predeclared test
.PHONY: deps
deps:
go get -d -v -t ./...
.PHONY: updatedeps
updatedeps:
go get -d -v -t -u -f ./...
.PHONY: install
install:
go install -ldflags '-X "main.version=dev build $(dev_build_version)"' .
.PHONY: release
release:
@go install github.com/goreleaser/[email protected]
goreleaser --rm-dist
.PHONY: docker
docker:
@echo $(dev_build_version) > VERSION
docker build -t fullstorydev/hauser:$(dev_build_version) .
@rm VERSION
.PHONY: checkgofmt
checkgofmt:
gofmt -s -l .
@if [ -n "$$(gofmt -s -l .)" ]; then \
exit 1; \
fi
.PHONY: vet
vet:
go vet ./...
.PHONY: staticcheck
staticcheck:
@go install honnef.co/go/tools/cmd/[email protected]
staticcheck ./...
.PHONY: ineffassign
ineffassign:
@go install github.com/gordonklaus/ineffassign@7953dde2c7bf
ineffassign .
.PHONY: predeclared
predeclared:
@go install github.com/nishanths/predeclared@86fad755b4d3
predeclared .
# Intentionally omitted from CI, but target here for ad-hoc reports.
.PHONY: golint
golint:
@go install golang.org/x/lint/golint@latest
golint -min_confidence 0.9 -set_exit_status ./...
# Intentionally omitted from CI, but target here for ad-hoc reports.
.PHONY: errcheck
errcheck:
@go install github.com/kisielk/errcheck@latest
errcheck ./...
.PHONY: test
test:
go test -race ./...