Skip to content

Commit

Permalink
Ignore the vendor and .build directories when running shellcheck.
Browse files Browse the repository at this point in the history
  • Loading branch information
staebler committed Aug 15, 2018
1 parent 5ac7cfb commit f6a54f3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion hack/shellcheck.sh
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit f6a54f3

Please sign in to comment.