-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
48 lines (41 loc) · 1.16 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
description := "Mixpanel API clients"
linter := $$(golangci-lint version)
.PHONY: all
all: about
@echo
@printf "%-12s %b\n" "bin-tools" "\e[0;90mInstall required binaries locally\e[0m"
@printf "%-12s %b\n" "format" "\e[0;90mRun go fmt\e[0m"
@printf "%-12s %b\n" "lint" "\e[0;90mRun golangci-lint\e[0m"
@printf "%-12s %b\n" "test" "\e[0;90mRun tests\e[0m"
@printf "%-12s %b\n" "outdated" "\e[0;90mCheck dependencies are not outdated\e[0m"
@echo
.PHONY: about
about:
@echo "$(description)"
.PHONY: bin-tools
bin-tools:
@echo Installing required binaries ...
@go generate -x tools.go
@echo
.PHONY: format
format:
@go fmt ./... ; go fix ./...
@echo
.PHONY: test
test:
@go test -count=1 -v ./...
@echo
.PHONY: lint
lint:
@echo $(linter)
@golangci-lint run
@echo
# Helper to notify availability of dependency updates.
# Also, if you use WSL to run this target, add alias to access tool-binary installed under Windows.
# Finally, this target is not necessary if your IDE can display updates notifications,
# but when cannot, install go-mod-outdated.
.PHONY: outdated
outdated:
@echo Checking outdated ...
@go list -u -m -json all | go-mod-outdated -direct -update
@echo