remove shellcheck bazel (#10369)

This commit is contained in:
Eric Liang
2020-08-27 12:36:57 -07:00
committed by GitHub
parent 0178d6318e
commit 583ad38f8f
-21
View File
@@ -78,10 +78,6 @@ SHELLCHECK_FLAGS=(
--exclude=2207 # "Prefer mapfile or read -a to split command output (or quote to avoid splitting)." -- these aren't compatible with macOS's old Bash
)
SHELLCHECK_BAZEL_FLAGS=(
--exclude=2043 # "This loop will only ever run once. Bad quoting or missing glob/expansion?" -- Bazel preprocessing can trigger this needlessly
)
YAPF_FLAGS=(
'--style' "$ROOT/.style.yapf"
'--recursive'
@@ -110,10 +106,6 @@ shellcheck_scripts() {
shellcheck "${SHELLCHECK_FLAGS[@]}" "$@"
}
shellcheck_bazel() {
"${ROOT}"/ci/travis/bazel.py shellcheck "mnemonic(\"Genrule\", deps(//:*))" shellcheck "${SHELLCHECK_FLAGS[@]}" "${SHELLCHECK_BAZEL_FLAGS[@]}" "$@"
}
# Format specified files
format_files() {
local shell_files=() python_files=() bazel_files=()
@@ -150,12 +142,6 @@ format_files() {
fi
if shellcheck --shell=sh --format=diff - < /dev/null; then
if [ 0 -lt "${#bazel_files[@]}" ]; then
if ! shellcheck_bazel; then
echo "Bazel genrule() scripts cannot be fixed automatically; please fix manually." 1>&2
shellcheck_bazel --format=diff
fi
fi
if [ 0 -lt "${#shell_files[@]}" ]; then
local difference
difference="$(shellcheck_scripts --format=diff "${shell_files[@]}" || true && printf "-")"
@@ -190,9 +176,6 @@ format_all() {
fi
if command -v shellcheck >/dev/null; then
echo "$(date)" "shellcheck bazel...."
shellcheck_bazel
local shell_files non_shell_files
non_shell_files=($(git ls-files -- ':(exclude)*.sh'))
shell_files=($(git ls-files -- '*.sh'))
@@ -242,10 +225,6 @@ format_changed() {
fi
if command -v shellcheck >/dev/null; then
if ! git diff --diff-filter=ACRM --quiet --exit-code "$MERGEBASE" -- 'WORKSPACE' 'WORKSPACE.*' 'BUILD.*' '*.bzl' '*.bazel' &>/dev/null; then
shellcheck_bazel
fi
local shell_files non_shell_files
non_shell_files=($(git diff --name-only --diff-filter=ACRM "$MERGEBASE" -- ':(exclude)*.sh'))
shell_files=($(git diff --name-only --diff-filter=ACRM "$MERGEBASE" -- '*.sh'))