Shellcheck comments (#9595)

This commit is contained in:
mehrdadn 2020-07-21 14:47:09 -07:00 committed by GitHub
parent a2f31195c6
commit 4f470c3fc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 24 additions and 0 deletions

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# This file exists for Jenkins compatiblity
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)

View file

@ -1,3 +1,4 @@
#!/usr/bin/env bash
source activate tensorflow_p36

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# This script build docker images for autoscaler.
# For now, we only build python3.6 images.
set -e

View file

@ -367,6 +367,7 @@ lint() {
# Checkout a clean copy of the repo to avoid seeing changes that have been made to the current one
(
WORKSPACE_DIR="$(TMPDIR="${WORKSPACE_DIR}/.." mktemp -d)"
# shellcheck disable=SC2030
ROOT_DIR="${WORKSPACE_DIR}"/ci/travis
git worktree add -q "${WORKSPACE_DIR}"
pushd "${WORKSPACE_DIR}"
@ -381,6 +382,7 @@ _check_job_triggers() {
job_names="$1"
local variable_definitions
# shellcheck disable=SC2031
variable_definitions=($(python "${ROOT_DIR}"/determine_tests_to_run.py))
if [ 0 -lt "${#variable_definitions[@]}" ]; then
local expression restore_shell_state=""
@ -392,6 +394,7 @@ _check_job_triggers() {
eval "${restore_shell_state}" "${expression}" # Restore set -x, then evaluate expression
fi
# shellcheck disable=SC2086
if ! (set +x && should_run_job ${job_names//,/ }); then
if [ "${GITHUB_ACTIONS-}" = true ]; then
# If this job is to be skipped, emit 'exit' into .bashrc to quickly exit all following steps.
@ -433,6 +436,7 @@ init() {
configure_system
# shellcheck disable=SC2031
. "${ROOT_DIR}"/install-dependencies.sh # Script is sourced to propagate up environment changes
}

View file

@ -86,6 +86,7 @@ if [ "${CI-}" = true ]; then
# If we are in master build, we can write to the cache as well.
upload=0
if [ "${TRAVIS_PULL_REQUEST-false}" = false ]; then
# shellcheck disable=SC2154
if [ -n "${BAZEL_CACHE_CREDENTIAL_B64:+x}" ]; then
{
printf "%s" "${BAZEL_CACHE_CREDENTIAL_B64}" | base64 -d - >> "${HOME}/bazel_cache_credential.json"
@ -93,11 +94,13 @@ if [ "${CI-}" = true ]; then
upload=1
elif [ -n "${encrypted_1c30b31fe1ee_key:+x}" ]; then
{
# shellcheck disable=SC2154
openssl aes-256-cbc -K "${encrypted_1c30b31fe1ee_key}" \
-iv "${encrypted_1c30b31fe1ee_iv}" \
-in "${ROOT_DIR}/bazel_cache_credential.json.enc" \
-out "${HOME}/bazel_cache_credential.json" -d
} 2>&- # avoid printing secrets
# shellcheck disable=SC2181
if [ 0 -eq $? ]; then
upload=1
fi

View file

@ -58,6 +58,7 @@ invoke_cc() {
case "${cc##*/}" in
clang*)
# Call iwyu with the modified arguments and environment variables (env -i starts with a blank slate)
# shellcheck disable=SC2016
{ PATH="${PATH}:/usr/bin" env -i "${env_vars[@]}" "${SHELL-/bin/bash}" -c 'iwyu -isystem "$("$1" -print-resource-dir "${@:2}")/include" "${@:2}"' exec "${args[@]}" 2>&1 || true; } | awk '
# Awk script to remove noise in the iwyu output
{ header = 0; }
@ -85,6 +86,7 @@ main() {
data="$(exec sed -e "s/\(0x[0-9a-fA-F]*\)]\(,\a\)/\"\1\"]\2/g" -e "s/,\(\a\s*\(]\|\$\)\)/\1/g" -e "s/\a/\n/g" <<< "${data}")"
# Parse the resulting JSON and select the actual fields we're interested in.
# We put the environment variables first, separating them from the command-line arguments via '--'.
# shellcheck disable=SC1003
data="$(PATH="${PATH}:${MINGW_DIR-/usr}/bin" && exec jq -r '(
[]
+ [.[1:][] | select (.[0] == 6) | "\(.[1][1])=\(.[2][1])" | gsub("'\''"; "'\''\\'\'''\''") | "'\''\(.)'\''"]

View file

@ -84,6 +84,7 @@ systemctl enable ray
echo "Starting ray..."
systemctl start ray
# shellcheck disable=SC2154
if [ "$type" = "head" ]; then
echo "Configure TensorBoard to start at boot..."
systemctl enable tensorboard

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# This script automatically download ray and run the sanity check (sanity_check.py)
# in various Python version. This script requires conda command to exist.

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
if [[ -z "$RAY_HASH" ]]; then
echo "RAY_HASH env var should be provided"
exit 1

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
cd ~/efs/lm
# download the dataset

View file

@ -1,6 +1,9 @@
#!/usr/bin/env bash
# Stop backend processes
ray stop
# Kill Java workers
# shellcheck disable=SC2009
ps aux | grep DefaultWorker | grep -v grep | awk '{print $2}' | xargs kill -9
# Remove temp files
rm -rf /tmp/ray