From a05fee746963ba65ea6888710da5c2d2d7ea1691 Mon Sep 17 00:00:00 2001 From: Ying Li Date: Sat, 14 Nov 2015 14:49:31 -0800 Subject: [PATCH] Make vet target now also checks for filenames with _test_ in the middle. Since if they are generic test helpers that should be exported, they should probably go into their own package. If they are used during testing, they should end in _test. Signed-off-by: Ying Li --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 0d7aeb8a60..8e221985ca 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,11 @@ ${PREFIX}/bin/notary-signer: NOTARY_VERSION $(shell find . -type f -name '*.go') vet: go_version @echo "+ $@" +ifeq ($(shell uname -s), Darwin) + @test -z "$(shell find . -iname *test*.go | grep -v _test.go | grep -v Godeps | xargs echo "This file should end with '_test':" | tee /dev/stderr)" +else + @test -z "$(shell find . -iname *test*.go | grep -v _test.go | grep -v Godeps | xargs -r echo "This file should end with '_test':" | tee /dev/stderr)" +endif @test -z "$$(go tool vet -printf=false . 2>&1 | grep -v Godeps/_workspace/src/ | tee /dev/stderr)" fmt: