forked from evilsocket/opensnitch
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
55 lines (39 loc) · 1.87 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
.PHONY: test tiny-snitch check check-static check-ineff check-err check-vet test-lib check-bodyclose check-nargs check-fmt check-hasdefault check-hasdefer check-govulncheck
all: tiny-snitch
tiny-snitch:
go build
check: check-deps check-static check-ineff check-err check-vet check-lint check-bodyclose check-nargs check-fmt check-hasdefault check-hasdefer check-govulncheck
check-deps:
@which staticcheck >/dev/null || (cd ~ && go install honnef.co/go/tools/cmd/staticcheck@latest)
@which golint >/dev/null || (cd ~ && go install golang.org/x/lint/golint@latest)
@which ineffassign >/dev/null || (cd ~ && go install github.com/gordonklaus/ineffassign@latest)
@which errcheck >/dev/null || (cd ~ && go install github.com/kisielk/errcheck@latest)
@which bodyclose >/dev/null || (cd ~ && go install github.com/timakin/bodyclose@latest)
@which nargs >/dev/null || (cd ~ && go install github.com/alexkohler/nargs/cmd/nargs@latest)
@which go-hasdefault >/dev/null || (cd ~ && go install github.com/nathants/go-hasdefault@latest)
@which go-hasdefer >/dev/null || (cd ~ && go install github.com/nathants/go-hasdefer@latest)
@which govulncheck >/dev/null || (cd ~ && go install golang.org/x/vuln/cmd/govulncheck@latest)
check-govulncheck: check-deps
@govulncheck ./...
check-hasdefault: check-deps
@go-hasdefault $(shell find -type f -name "*.go") || true
check-hasdefer: check-deps
@go-hasdefer $(shell find -type f -name "*.go") || true
check-fmt: check-deps
@go fmt ./... >/dev/null
check-nargs: check-deps
@nargs ./...
check-bodyclose: check-deps
@go vet -vettool=$(shell which bodyclose) ./...
check-lint: check-deps
@golint ./... | grep -v -e unexported -e "should be" || true
check-static: check-deps
@staticcheck ./...
check-ineff: check-deps
@ineffassign ./...
check-err: check-deps
@errcheck ./...
check-vet: check-deps
@go vet ./...
test:
false