From db590ecd8965b20751b6b2e745cf975acbb9fd81 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Sat, 6 Jan 2024 23:35:52 -0800 Subject: [PATCH] Fix scripts to avoid testdata --- hack/boilerplate/boilerplate.py | 1 + hack/update-gofmt.sh | 1 + hack/update-netparse-cve.sh | 3 ++- hack/verify-gofmt.sh | 2 +- test/instrumentation/stability-utils.sh | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hack/boilerplate/boilerplate.py b/hack/boilerplate/boilerplate.py index d5604f4a9c6..04009e979eb 100755 --- a/hack/boilerplate/boilerplate.py +++ b/hack/boilerplate/boilerplate.py @@ -152,6 +152,7 @@ skipped_names = [ ".git", "cluster/env.sh", "vendor", + "testdata", "test/e2e/generated/bindata.go", "hack/boilerplate/test", "staging/src/k8s.io/kubectl/pkg/generated/bindata.go", diff --git a/hack/update-gofmt.sh b/hack/update-gofmt.sh index c5031223d45..5cb40252678 100755 --- a/hack/update-gofmt.sh +++ b/hack/update-gofmt.sh @@ -36,6 +36,7 @@ function git_find() { ':!:*/vendor/*' `# catches any subdir/vendor/...` \ ':!:third_party/*' `# catches third_party/...` \ ':!:*/third_party/*' `# catches third_party/...` \ + ':!:*/testdata/*' `# catches any subdir/testdata/...` \ ':(glob)**/*.go' \ "$@" } diff --git a/hack/update-netparse-cve.sh b/hack/update-netparse-cve.sh index dd8af6141f2..ef7f9712c59 100755 --- a/hack/update-netparse-cve.sh +++ b/hack/update-netparse-cve.sh @@ -53,7 +53,8 @@ function git_find() { ':!:vendor/*' `# catches vendor/...` \ ':!:*/vendor/*' `# catches any subdir/vendor/...` \ ':!:third_party/*' `# catches third_party/...` \ - ':!:*/third_party/*' `# catches third_party/...` \ + ':!:*/third_party/*' `# catches any subdir/third_party/...` \ + ':!:*/testdata/*' `# catches any subdir/testdata/...` \ ':(glob)**/*.go' \ "$@" } diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh index 0086821d89f..20389a7a85b 100755 --- a/hack/verify-gofmt.sh +++ b/hack/verify-gofmt.sh @@ -43,7 +43,7 @@ find_files() { -o -wholename './target' \ -o -wholename '*/third_party/*' \ -o -wholename '*/vendor/*' \ - -o -wholename './staging/src/k8s.io/client-go/*vendor/*' \ + -o -wholename '*/testdata/*' \ -o -wholename '*/bindata.go' \ \) -prune \ \) -name '*.go' diff --git a/test/instrumentation/stability-utils.sh b/test/instrumentation/stability-utils.sh index 19227cca715..e42ac552c10 100755 --- a/test/instrumentation/stability-utils.sh +++ b/test/instrumentation/stability-utils.sh @@ -36,6 +36,7 @@ function find_files_to_check() { git ls-files -cmo --exclude-standard \ ':!:vendor/*' `# catches vendor/...` \ ':!:*/vendor/*' `# catches any subdir/vendor/...` \ + ':!:*/testdata/*' `# catches any subdir/testdata/...` \ ':!:third_party/*' `# catches third_party/...` \ ':!:*/third_party/*' `# catches third_party/...` \ ':!:hack/*' `# catches hack/...` \