Skip to content

Commit bca82f2

Browse files
authored
Merge pull request #448 from mdlayher/ci-staticcheck
Run staticcheck from Makefile, remove duplicate end-to-end test call …
2 parents 6aa9afc + 748f835 commit bca82f2

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ go:
77

88
script:
99
- make
10-
- ./end-to-end-test.sh

Makefile

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313

1414
GO ?= GO15VENDOREXPERIMENT=1 go
1515
GOPATH := $(firstword $(subst :, ,$(GOPATH)))
16-
PROMU ?= $(GOPATH)/bin/promu
17-
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
16+
17+
PROMU ?= $(GOPATH)/bin/promu
18+
STATICCHECK ?= $(GOPATH)/bin/staticcheck
19+
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
1820

1921
PREFIX ?= $(shell pwd)
2022
BIN_DIR ?= $(shell pwd)
@@ -33,7 +35,7 @@ else
3335
test-e2e := skip-test-e2e
3436
endif
3537

36-
all: format build test $(test-e2e)
38+
all: format vet staticcheck build test $(test-e2e)
3739

3840
style:
3941
@echo ">> checking code style"
@@ -58,6 +60,10 @@ vet:
5860
@echo ">> vetting code"
5961
@$(GO) vet $(pkgs)
6062

63+
staticcheck: $(STATICCHECK)
64+
@echo ">> running staticcheck"
65+
@$(STATICCHECK) $(pkgs)
66+
6167
build: $(PROMU)
6268
@echo ">> building binaries"
6369
@$(PROMU) build --prefix $(PREFIX)
@@ -71,9 +77,10 @@ docker:
7177
@docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
7278

7379
$(GOPATH)/bin/promu promu:
74-
@GOOS=$(shell uname -s | tr A-Z a-z) \
75-
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
76-
$(GO) get -u github.com/prometheus/promu
80+
@GOOS= GOARCH= $(GO) get -u github.com/prometheus/promu
81+
82+
$(GOPATH)/bin/staticcheck:
83+
@GOOS= GOARCH= $(GO) get -u honnef.co/go/tools/cmd/staticcheck
7784

7885

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

0 commit comments

Comments
 (0)