-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (37 loc) · 1.24 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
precommit: ensure format generate test check addlicense
@echo "ready to commit"
ensure:
go mod tidy
go mod verify
go mod vendor
format:
find . -type f -name '*.go' -not -path './vendor/*' -exec gofmt -w "{}" +
find . -type f -name '*.go' -not -path './vendor/*' -exec go run -mod=vendor github.com/incu6us/goimports-reviser -project-name github.com/bborbe/world -file-path "{}" \;
generate:
rm -rf mocks avro
go generate -mod=vendor ./...
test:
go test -mod=vendor -p=$${GO_TEST_PARALLEL:-1} -cover -race $(shell go list -mod=vendor ./... | grep -v /vendor/)
check: lint vet errcheck
vet:
go vet -mod=vendor $(shell go list -mod=vendor ./... | grep -v /vendor/)
lint:
go run -mod=vendor golang.org/x/lint/golint -min_confidence 1 $(shell go list -mod=vendor ./... | grep -v /vendor/)
errcheck:
go run -mod=vendor github.com/kisielk/errcheck -ignore '(Close|Write|Fprint)' $(shell go list -mod=vendor ./... | grep -v /vendor/)
addlicense:
go run -mod=vendor github.com/google/addlicense -c "Benjamin Borbe" -y 2023 -l bsd ./*.go
install:
GOBIN=$(GOPATH)/bin go install worklog.go
run:
worklog \
-author "Benjamin Borbe" \
-dir "" \
-logtostderr \
-v=4
rundebug:
worklog \
-author "Benjamin Borbe" \
-dir "" \
-logtostderr \
-v=4