1
hermetic_cc_toolchain/ci/lint

27 lines
685 B
Plaintext
Raw Permalink Normal View History

#!/usr/bin/env bash
# Copyright 2023 Uber Technologies, Inc.
# Licensed under the Apache License, Version 2.0
set -euo pipefail
2022-07-29 00:10:11 +03:00
cd "$(git rev-parse --show-toplevel)"
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"
fi
2023-02-20 07:48:09 +02:00
>&2 echo "--- buildifier :bazel:"
tools/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