2022-07-27 23:33:53 +03:00
|
|
|
#!/usr/bin/env bash
|
2023-03-02 23:42:35 +02:00
|
|
|
|
|
|
|
# Copyright 2023 Uber Technologies, Inc.
|
|
|
|
# Licensed under the Apache License, Version 2.0
|
|
|
|
|
2022-04-13 15:58:11 +03:00
|
|
|
set -euo pipefail
|
|
|
|
|
2022-07-29 00:10:11 +03:00
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
2022-04-13 15:58:11 +03:00
|
|
|
|
2022-07-29 00:10:11 +03:00
|
|
|
|
2023-02-20 07:48:09 +02:00
|
|
|
if command -v shellcheck &> /dev/null; then
|
|
|
|
mapfile -t files < \
|
|
|
|
<(git ls-files)
|
|
|
|
mapfile -t scripts < \
|
|
|
|
<(awk '/#!(\/usr\/bin\/env bash|\/bin\/sh)/&&FNR==1{print FILENAME}' "${files[@]}")
|
|
|
|
>&2 echo "shellcheck"
|
|
|
|
for f in "${scripts[@]}"; do >&2 echo " $f"; done
|
|
|
|
shellcheck "${scripts[@]}"
|
|
|
|
>&2 echo -e "OK\n"
|
2022-09-29 12:11:34 +03:00
|
|
|
fi
|
2023-02-20 07:48:09 +02:00
|
|
|
|
|
|
|
>&2 echo "--- buildifier :bazel:"
|
|
|
|
bin/buildifier -r -mode check "$PWD"
|
2022-07-29 00:10:11 +03:00
|
|
|
>&2 echo -e "OK\n"
|
2023-02-20 07:48:09 +02:00
|
|
|
|
|
|
|
>&2 echo "--- Gazelle :goat:"
|
|
|
|
tools/bazel run //:gazelle -- -mode diff
|