From 3bf3a72bebe3dc58791cd5e16b4afbd0c12e5c23 Mon Sep 17 00:00:00 2001 From: Andrew Dye Date: Mon, 20 May 2024 16:11:10 -0700 Subject: [PATCH] Pin goimports, skip gen dir Signed-off-by: Andrew Dye --- boilerplate/flyte/golang_test_targets/Makefile | 2 +- boilerplate/flyte/golang_test_targets/download_tooling.sh | 1 + boilerplate/flyte/golang_test_targets/goimports | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/boilerplate/flyte/golang_test_targets/Makefile b/boilerplate/flyte/golang_test_targets/Makefile index b1a689c652f..44b6571e6b2 100644 --- a/boilerplate/flyte/golang_test_targets/Makefile +++ b/boilerplate/flyte/golang_test_targets/Makefile @@ -19,7 +19,7 @@ lint: download_tooling #lints the package for common code smells # If code is failing goimports linter, this will fix. # skips 'vendor' .PHONY: goimports -goimports: +goimports: download_tooling @${REPO_ROOT}/boilerplate/flyte/golang_test_targets/goimports .PHONY: mod_download diff --git a/boilerplate/flyte/golang_test_targets/download_tooling.sh b/boilerplate/flyte/golang_test_targets/download_tooling.sh index 33d07d75004..55ed7a8dcd5 100755 --- a/boilerplate/flyte/golang_test_targets/download_tooling.sh +++ b/boilerplate/flyte/golang_test_targets/download_tooling.sh @@ -21,6 +21,7 @@ tools=( "github.com/daixiang0/gci" "github.com/alvaroloes/enumer" "github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc" + "golang.org/x/tools/cmd/goimports@v0.21.0" ) # This ensures pflags are up to date. diff --git a/boilerplate/flyte/golang_test_targets/goimports b/boilerplate/flyte/golang_test_targets/goimports index b4eb88e9cb4..2eb74388471 100755 --- a/boilerplate/flyte/golang_test_targets/goimports +++ b/boilerplate/flyte/golang_test_targets/goimports @@ -5,5 +5,5 @@ # # TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst -goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*" -not -path "./boilerplate/*") +goimports -w $(find . -type f -name '*.go' -not -path "./vendor/*" -not -path "./pkg/client/*" -not -path "./boilerplate/*" -not -path "./gen/*") GL_DEBUG=linters_output,env golangci-lint run --timeout=5m --exclude deprecated -v --fix