diff options
author | Matt Layher <mdlayher@gmail.com> | 2017-02-02 12:50:28 -0500 |
---|---|---|
committer | Matt Layher <mdlayher@gmail.com> | 2017-03-02 10:52:41 -0500 |
commit | 748f835171c10dad32ab29dcf1b0b31e89db056b (patch) | |
tree | 6982df89af04eab8a40dbef9d30dd9114e6dc404 /Makefile | |
parent | 5d22d41ed7d7355979756f6410c6bc01c98ca5af (diff) | |
download | prometheus_node_collector-748f835171c10dad32ab29dcf1b0b31e89db056b.tar.bz2 prometheus_node_collector-748f835171c10dad32ab29dcf1b0b31e89db056b.tar.xz prometheus_node_collector-748f835171c10dad32ab29dcf1b0b31e89db056b.zip |
Run staticcheck from Makefile, remove duplicate end-to-end test call in CI
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -13,8 +13,10 @@ | |||
13 | 13 | ||
14 | GO ?= GO15VENDOREXPERIMENT=1 go | 14 | GO ?= GO15VENDOREXPERIMENT=1 go |
15 | GOPATH := $(firstword $(subst :, ,$(GOPATH))) | 15 | GOPATH := $(firstword $(subst :, ,$(GOPATH))) |
16 | PROMU ?= $(GOPATH)/bin/promu | 16 | |
17 | pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | 17 | PROMU ?= $(GOPATH)/bin/promu |
18 | STATICCHECK ?= $(GOPATH)/bin/staticcheck | ||
19 | pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | ||
18 | 20 | ||
19 | PREFIX ?= $(shell pwd) | 21 | PREFIX ?= $(shell pwd) |
20 | BIN_DIR ?= $(shell pwd) | 22 | BIN_DIR ?= $(shell pwd) |
@@ -33,7 +35,7 @@ else | |||
33 | test-e2e := skip-test-e2e | 35 | test-e2e := skip-test-e2e |
34 | endif | 36 | endif |
35 | 37 | ||
36 | all: format build test $(test-e2e) | 38 | all: format vet staticcheck build test $(test-e2e) |
37 | 39 | ||
38 | style: | 40 | style: |
39 | @echo ">> checking code style" | 41 | @echo ">> checking code style" |
@@ -58,6 +60,10 @@ vet: | |||
58 | @echo ">> vetting code" | 60 | @echo ">> vetting code" |
59 | @$(GO) vet $(pkgs) | 61 | @$(GO) vet $(pkgs) |
60 | 62 | ||
63 | staticcheck: $(STATICCHECK) | ||
64 | @echo ">> running staticcheck" | ||
65 | @$(STATICCHECK) $(pkgs) | ||
66 | |||
61 | build: $(PROMU) | 67 | build: $(PROMU) |
62 | @echo ">> building binaries" | 68 | @echo ">> building binaries" |
63 | @$(PROMU) build --prefix $(PREFIX) | 69 | @$(PROMU) build --prefix $(PREFIX) |
@@ -71,9 +77,10 @@ docker: | |||
71 | @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . | 77 | @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . |
72 | 78 | ||
73 | $(GOPATH)/bin/promu promu: | 79 | $(GOPATH)/bin/promu promu: |
74 | @GOOS=$(shell uname -s | tr A-Z a-z) \ | 80 | @GOOS= GOARCH= $(GO) get -u github.com/prometheus/promu |
75 | GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ | 81 | |
76 | $(GO) get -u github.com/prometheus/promu | 82 | $(GOPATH)/bin/staticcheck: |
83 | @GOOS= GOARCH= $(GO) get -u honnef.co/go/tools/cmd/staticcheck | ||
77 | 84 | ||
78 | 85 | ||
79 | .PHONY: all style format build test test-e2e vet tarball docker promu $(GOPATH)/bin/promu | 86 | .PHONY: all style format build test test-e2e vet tarball docker promu staticcheck $(GOPATH)/bin/promu $(GOPATH)/bin/staticcheck |