From db01d68d0543f5ed8ab4bbfbe0d9c6223597137f Mon Sep 17 00:00:00 2001 From: Bob Killen Date: Wed, 27 Mar 2019 15:49:37 -0400 Subject: [PATCH] Update hack/verify-shellcheck.sh to ignore ./third_party/* The ./third_party/* directory contains scripts, libraries and other components from external sources. These should be omitted from lints and checks with the exception of things that are forked and modified (located in ./third_party/forked/*) for project related reasons. --- hack/.shellcheck_failures | 3 --- hack/verify-shellcheck.sh | 12 +++++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index b5b1c14911f..3ffe41857e2 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -90,6 +90,3 @@ ./test/images/volume/gluster/run_gluster.sh ./test/images/volume/iscsi/create_block.sh ./test/images/volume/nfs/run_nfs.sh -./third_party/intemp/intemp.sh -./third_party/multiarch/qemu-user-static/register/qemu-binfmt-conf.sh -./third_party/multiarch/qemu-user-static/register/register.sh diff --git a/hack/verify-shellcheck.sh b/hack/verify-shellcheck.sh index bd1483d4441..7b2e4372fce 100755 --- a/hack/verify-shellcheck.sh +++ b/hack/verify-shellcheck.sh @@ -66,8 +66,13 @@ remove_container () { # ensure we're linting the k8s source tree cd "${KUBE_ROOT}" -# find all shell scripts excluding ./_*, ./.git/*, ./vendor*, -# and anything git-ignored +# Find all shell scripts excluding: +# - Anything git-ignored - No need to lint untracked files. +# - ./_* - No need to lint output directories. +# - ./.git/* - Ignore anything in the git object store. +# - ./vendor* - Vendored code should be fixed upstream instead. +# - ./third_party/*, but re-include ./third_party/forked/* - only code we +# forked should be linted and fixed. all_shell_scripts=() while IFS=$'\n' read -r script; do git check-ignore -q "$script" || all_shell_scripts+=("$script"); @@ -75,7 +80,8 @@ done < <(find . -name "*.sh" \ -not \( \ -path ./_\* -o \ -path ./.git\* -o \ - -path ./vendor\* \ + -path ./vendor\* -o \ + \( -path ./third_party\* -a -not -path ./third_party/forked\* \) \ \)) # make sure known failures are sorted