Commit d0b944a 1 parent 43d52de commit d0b944a Copy full SHA for d0b944a
File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
DEPS = $(wildcard * /* .go)
2
2
VERSION = $(shell git describe --always --dirty)
3
3
4
- all : prometheus-puppetdb prometheus-puppetdb.1
4
+ all : imports lint vet prometheus-puppetdb prometheus-puppetdb.1
5
5
6
6
prometheus-puppetdb : main.go $(DEPS )
7
7
CGO_ENABLED=0 GOOS=linux \
@@ -16,4 +16,19 @@ prometheus-puppetdb.1: prometheus-puppetdb
16
16
clean :
17
17
rm -f prometheus-puppetdb prometheus-puppetdb.1
18
18
19
- .PHONY : all clean
19
+ lint :
20
+ @ go get -v github.com/golang/lint/golint
21
+ @for file in $$(git ls-files '*.go' | grep -v '_workspace/' ) ; do \
22
+ export output=" $$ (golint $$ {file} | grep -v 'type name will be used as docker.DockerInfo')" ; \
23
+ [ -n " $$ {output}" ] && echo " $$ {output}" && export status=1; \
24
+ done ; \
25
+ exit $$ {status:-0}
26
+
27
+ vet : main.go
28
+ go vet $<
29
+
30
+ imports : main.go
31
+ dep ensure -vendor-only
32
+ goimports -d $<
33
+
34
+ .PHONY : all lint clean
You can’t perform that action at this time.
0 commit comments