ci/lint: more verbose output
This commit is contained in:
parent
8b5c41e409
commit
09ebb03d47
22
ci/lint
22
ci/lint
|
@ -1,9 +1,21 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
cd "$REPO_ROOT"
|
|
||||||
|
|
||||||
# shellcheck disable=SC2046
|
mapfile -t files < \
|
||||||
shellcheck -x $(awk '/#!\/usr\/bin\/env/&&FNR==1{print FILENAME}' $(git ls-files))
|
<(git ls-files)
|
||||||
find . \( -name 'WORKSPACE' -o -name 'BUILD' -o -name '*.bzl' \) -exec buildifier {} +
|
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"
|
||||||
|
|
Loading…
Reference in New Issue