-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile
50 lines (38 loc) · 1.28 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
GO := GO15VENDOREXPERIMENT=1 go
FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
pkgs = $(shell $(GO) list ./... | grep -v /vendor/ )
BUILD_ENTRY ?= ./*.go
BINARY ?= awx-go
all: format vendor-status build test
style:
@echo ">> checking code style"
@! gofmt -d $(shell find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
install-test-reqs:
@$(GO) get -u github.com/kylelemons/godebug/pretty
@$(GO) get -u github.com/kylelemons/godebug/diff
test-short: install-test-reqs
@echo ">> running short tests"
@$(GO) test -short $(pkgs)
test: install-test-reqs
@echo ">> running all tests"
@$(GO) test $(pkgs)
lint: install-test-reqs
@gometalinter --vendor --disable-all --enable=gosimple --enable=golint --enable=vet --enable=ineffassign --enable=unconvert \
--exclude="by other packages, and that stutters; consider calling this" \
--skip=proto \
--skip=vendor \
--skip=.git \
--tests ./...
format:
@echo ">> formatting code"
@$(GO) fmt $(pkgs)
vet:
@echo ">> vetting code"
@$(GO) vet $(pkgs)
vendor-status:
@echo ">> vendor status"
@govendor status
build:
@echo ">> building binaries"
@$(GO) build -o $(BINARY) $(BUILD_ENTRY)
.PHONY: all style format build test test-short vet vendor-status