forked from Originate/dcos-login
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (35 loc) · 1.2 KB
/
Copy pathMakefile
File metadata and controls
44 lines (35 loc) · 1.2 KB
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
PACKAGES?=$$(glide novendor)
default: test
tools:
go get -u github.com/Masterminds/glide
go get -u github.com/golang/lint/golint
go get -u github.com/mitchellh/gox
go get -u github.com/tcnksm/ghr
# dev creates binaries for testing locally. These are put
# into ./bin/ as well as $GOPATH/bin
dev: fmtcheck
go install $(PACKAGES)
# test runs the unit tests with race detection
test: fmtcheck
go test -race $(PACKAGES) $(TESTARGS)
# vet runs the Go source code static analysis tool `vet` to find
# any common errors.
vet:
@echo "go tool vet ."
@go tool vet -all $$(ls -d */ | grep -v vendor) ; if [ $$? -eq 1 ]; then \
echo ""; \
echo "Vet found suspicious constructs. Please check the reported constructs"; \
echo "and fix them if necessary before submitting the code for review."; \
exit 1; \
fi
# lint runs the Go source code static analysis tool `golint` to find
# any common style errors.
lint:
@for PACKAGE in $$(find . -iname '*.go' -exec dirname {} \; | grep -v 'vendor' | sort | uniq) ; do \
golint $$(find $$PACKAGE -name '*.go' -maxdepth 1 | grep -v 'test.go'); \
done
fmt:
go fmt $(PACKAGES)
fmtcheck:
@sh -c "'$(CURDIR)/scripts/ci/fmt-check'"
.PHONY: test vet lint fmt fmtcheck tools