diff --git a/Makefile b/Makefile index 95cc13b7..621cec71 100644 --- a/Makefile +++ b/Makefile @@ -39,11 +39,12 @@ push: container docker push $(IMAGE_NAME):$(IMAGE_VERSION) test: - if ! [ $$(go fmt $$(go list ./... | grep -v vendor) | wc -l) -eq 0 ]; then \ - echo "formatting errors:"; \ - go fmt $$(go list ./... | grep -v vendor); \ - false; \ - fi + files=$$(find ./ -name '*.go' | grep -v '^./vendor' ); \ + if [ $$(gofmt -d $$files | wc -l) -ne 0 ]; then \ + echo "formatting errors:"; \ + gofmt -d $$files; \ + false; \ + fi go vet $$(go list ./... | grep -v vendor) go test $$(go list ./... | grep -v vendor | grep -v "cmd/csi-sanity") ./hack/e2e.sh