1
hermetic_cc_toolchain/ci/lint
Motiejus Jakštys 73a9ceccfb
revert "Re-license portions of the code to Apache 2.0" (#35)
This (partially) reverts commit dfdb1f2680
2023-04-19 20:23:25 -04:00

27 lines
669 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright 2023 Uber Technologies, Inc.
# Licensed under the MIT License
set -euo pipefail
cd "$(git rev-parse --show-toplevel)"
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
>&2 echo "--- buildifier :bazel:"
tools/buildifier -r -mode check "$PWD"
>&2 echo -e "OK\n"
>&2 echo "--- Gazelle :goat:"
tools/bazel run //:gazelle -- -mode diff