From f6a54f3bf5ec953b256862cbf640f6198e2573d0 Mon Sep 17 00:00:00 2001 From: staebler Date: Wed, 15 Aug 2018 14:59:09 -0400 Subject: [PATCH] Ignore the vendor and .build directories when running shellcheck. --- hack/shellcheck.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hack/shellcheck.sh b/hack/shellcheck.sh index 509a6d97293..1b553ba7c79 100755 --- a/hack/shellcheck.sh +++ b/hack/shellcheck.sh @@ -1,6 +1,10 @@ #!/bin/sh if [ "$IS_CONTAINER" != "" ]; then - find "${1:-.}" -type f -name '*.sh' -exec shellcheck --format=gcc {} \+ + TOP_DIR="${1:-.}" + find "${TOP_DIR}" \ + -path "${TOP_DIR}/vendor" -prune \ + -o -path "${TOP_DIR}/.build" -prune \ + -o -type f -name '*.sh' -exec shellcheck --format=gcc {} \+ else docker run -e IS_CONTAINER='TRUE' --rm -v "$(pwd)":/workdir:ro --entrypoint sh quay.io/coreos/shellcheck-alpine:v0.5.0 /workdir/hack/shellcheck.sh /workdir; fi;