Skip to content

Commit

Permalink
contrib/scripts: Ignore all vendor sub-directories
Browse files Browse the repository at this point in the history
Make these check scripts slightly more future-proof by ignoring all
sub-directories named vendor.

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
  • Loading branch information
michi-covalent committed May 22, 2023
1 parent 2f9c40c commit c985693
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contrib/scripts/check-fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set -o pipefail
_goroot=$(${GO:-go} env GOROOT)

diff="$(find . ! \( -path './contrib' -prune \) \
! \( -path './vendor' -prune \) \
! \( -regex '.*/vendor/.*' -prune \) \
! \( -path './_build' -prune \) \
! \( -path './.git' -prune \) \
! \( -path '*.validate.go' -prune \) \
Expand Down
8 changes: 4 additions & 4 deletions contrib/scripts/check-k8s-code-gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ set -e
set -o pipefail

# Delete all zz_generated.deepcopy.go files
find . -not -path "./vendor/*" -not -path "./_build/*" -name "zz_generated.deepcopy.go" -exec rm {} \;
find . -not -regex ".*/vendor/.*" -not -path "./_build/*" -name "zz_generated.deepcopy.go" -exec rm {} \;
# Delete all zz_generated.deepequal.go files
find . -not -path "./vendor/*" -not -path "./_build/*" -name "zz_generated.deepequal.go" -exec rm {} \;
find . -not -regex ".*/vendor/.*" -not -path "./_build/*" -name "zz_generated.deepequal.go" -exec rm {} \;
# Delete all generated proto and proto go files
find . -not -path "./vendor/*" -not -path "./_build/*" -name "generated.pb.go" -exec rm {} \;
find . -not -path "./vendor/*" -not -path "./_build/*" -name "generated.proto" -exec rm {} \;
find . -not -regex ".*/vendor/.*" -not -path "./_build/*" -name "generated.pb.go" -exec rm {} \;
find . -not -regex ".*/vendor/.*" -not -path "./_build/*" -name "generated.proto" -exec rm {} \;
# Delete cilium clientsets, informers & listers
rm -rf ./pkg/k8s/client/{clientset,informers,listers}
# Delete k8s slim clients
Expand Down
2 changes: 1 addition & 1 deletion contrib/scripts/rand-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ for l in rand\.NewSource; do
-not -path "./_build/*" \
-not -path "./contrib/*" \
-not -path "./pkg/rand/*" \
-not -path "./vendor/*" \
-not -regex ".*/vendor/.*" \
-not -path "./test/*" \
-print0 \
| xargs -0 grep --exclude NewSafeSource "$l")
Expand Down

0 comments on commit c985693

Please sign in to comment.