From 09ebb03d472dedf4a86150deb98975f8351dd6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Thu, 28 Jul 2022 14:10:11 -0700 Subject: [PATCH] ci/lint: more verbose output --- ci/lint | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/ci/lint b/ci/lint index f84eaa1..8d3c919 100755 --- a/ci/lint +++ b/ci/lint @@ -1,9 +1,21 @@ #!/usr/bin/env bash set -euo pipefail -REPO_ROOT=$(git rev-parse --show-toplevel) -cd "$REPO_ROOT" +cd "$(git rev-parse --show-toplevel)" -# shellcheck disable=SC2046 -shellcheck -x $(awk '/#!\/usr\/bin\/env/&&FNR==1{print FILENAME}' $(git ls-files)) -find . \( -name 'WORKSPACE' -o -name 'BUILD' -o -name '*.bzl' \) -exec buildifier {} + +mapfile -t files < \ + <(git ls-files) +mapfile -t scripts < \ + <(awk '/#!\/usr\/bin\/env/&&FNR==1{print FILENAME}' "${files[@]}") +mapfile -t buildfiles < \ + <(find . \( -name 'WORKSPACE' -o -name 'BUILD' -o -name '*.bzl' \)) + +>&2 echo "shellcheck" +for f in "${scripts[@]}"; do >&2 echo " $f"; done +shellcheck -x "${scripts[@]}" +>&2 echo -e "OK\n" + +>&2 echo "buildifier" +for f in "${buildfiles[@]}"; do >&2 echo " $f"; done +buildifier "${buildfiles[@]}" +>&2 echo -e "OK\n"