mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 02:21:34 +00:00
Add standard lint tools to Makefile
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
This commit is contained in:
parent
d504afe479
commit
b93922a1c5
11
Makefile
11
Makefile
@ -6,9 +6,18 @@ default: moby
|
|||||||
DEPS=$(wildcard cmd/moby/*.go) Makefile
|
DEPS=$(wildcard cmd/moby/*.go) Makefile
|
||||||
PREFIX?=/usr/local
|
PREFIX?=/usr/local
|
||||||
|
|
||||||
moby: $(DEPS)
|
moby: $(DEPS) lint
|
||||||
go build --ldflags "-X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)" -o $@ github.com/moby/tool/cmd/moby
|
go build --ldflags "-X main.GitCommit=$(GIT_COMMIT) -X main.Version=$(VERSION)" -o $@ github.com/moby/tool/cmd/moby
|
||||||
|
|
||||||
|
lint:
|
||||||
|
@echo "+ $@: golint, gofmt, go vet"
|
||||||
|
# golint
|
||||||
|
@test -z "$(shell find . -type f -name "*.go" -not -path "./vendor/*" -not -name "*.pb.*" -exec golint {} \; | tee /dev/stderr)"
|
||||||
|
# gofmt
|
||||||
|
@test -z "$$(gofmt -s -l .| grep -v .pb. | grep -v vendor/ | tee /dev/stderr)"
|
||||||
|
# govet
|
||||||
|
@test -z "$$(go tool vet -printf=false . 2>&1 | grep -v vendor/ | tee /dev/stderr)"
|
||||||
|
|
||||||
PHONY: install
|
PHONY: install
|
||||||
install: moby
|
install: moby
|
||||||
cp -a $^ $(PREFIX)/bin/
|
cp -a $^ $(PREFIX)/bin/
|
||||||
|
Loading…
Reference in New Issue
Block a user