From b6f3effc5bfd1d4449fce3eac66532ca1f99cb84 Mon Sep 17 00:00:00 2001 From: Mahmood Ali Date: Mon, 9 Mar 2020 15:06:47 -0400 Subject: [PATCH] ci: add a check for non-vendored packages This check fails the lint-go CI job if nomad references a package that is not vendored. --- GNUmakefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index c73c0052f..e917b2697 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -179,6 +179,9 @@ check: ## Lint the source code @echo "==> Check API package is isolated from rest" @if go list --test -f '{{ join .Deps "\n" }}' ./api | grep github.com/hashicorp/nomad/ | grep -v -e /vendor/ -e /nomad/api/ -e nomad/api.test; then echo " /api package depends the ^^ above internal nomad packages. Remove such dependency"; exit 1; fi + @echo "==> Check non-vendored packages" + @if go list --test -tags "$(GO_TAGS)" -f '{{join .Deps "\n"}}' . | grep -v github.com/hashicorp/nomad.test | xargs go list -tags "$(GO_TAGS)" -f '{{if not .Standard}}{{.ImportPath}}{{end}}' | grep -v -e github.com/hashicorp/nomad; then echo " found referenced packages ^^ that are not vendored"; exit 1; fi + .PHONY: checkscripts checkscripts: ## Lint shell scripts @echo "==> Linting scripts..."