Skip to content

Commit

Permalink
Fix quoting in shell scripts per shellcheck-0.9 (#6245)
Browse files Browse the repository at this point in the history
Fix instances of `SC2086: Double quote to prevent globbing and word splitting`.

Ref: https://www.shellcheck.net/wiki/SC2086
  • Loading branch information
pavoljuhas committed Aug 15, 2023
1 parent 13f05fd commit 9fbaa05
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions check/build-changed-protos
Expand Up @@ -47,8 +47,8 @@ else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
exit 1
fi
base="$(git merge-base ${rev} HEAD)"
if [ "$(git rev-parse ${rev})" == "${base}" ]; then
base="$(git merge-base "${rev}" HEAD)"
if [ "$(git rev-parse "${rev}")" == "${base}" ]; then
echo -e "Comparing against revision '${rev}'." >&2
else
echo -e "Comparing against revision '${rev}' (merge base ${base})." >&2
Expand Down
4 changes: 2 additions & 2 deletions check/format-incremental
Expand Up @@ -72,8 +72,8 @@ if (( only_changed == 1 )); then
exit 1
fi
fi
base="$(git merge-base ${rev} HEAD)"
if [ "$(git rev-parse ${rev})" == "${base}" ]; then
base="$(git merge-base "${rev}" HEAD)"
if [ "$(git rev-parse "${rev}")" == "${base}" ]; then
echo -e "Comparing against revision '${rev}'." >&2
else
echo -e "Comparing against revision '${rev}' (merge base ${base})." >&2
Expand Down
4 changes: 2 additions & 2 deletions check/pylint-changed-files
Expand Up @@ -46,8 +46,8 @@ else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
exit 1
fi
base="$(git merge-base ${rev} HEAD)"
if [ "$(git rev-parse ${rev})" == "${base}" ]; then
base="$(git merge-base "${rev}" HEAD)"
if [ "$(git rev-parse "${rev}")" == "${base}" ]; then
echo -e "Comparing against revision '${rev}'." >&2
else
echo -e "Comparing against revision '${rev}' (merge base ${base})." >&2
Expand Down
4 changes: 2 additions & 2 deletions check/pytest-and-incremental-coverage
Expand Up @@ -60,8 +60,8 @@ else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
exit 1
fi
base="$(git merge-base ${rev} HEAD)"
if [ "$(git rev-parse ${rev})" == "${base}" ]; then
base="$(git merge-base "${rev}" HEAD)"
if [ "$(git rev-parse "${rev}")" == "${base}" ]; then
echo -e "Comparing against revision '${rev}'." >&2
else
echo -e "Comparing against revision '${rev}' (merge base ${base})." >&2
Expand Down
2 changes: 1 addition & 1 deletion check/pytest-changed-files
Expand Up @@ -56,7 +56,7 @@ echo "Comparing against revision '${rev}'." >&2
# Get the _test version of changed python files.
typeset -a changed
IFS=$'\n' read -r -d '' -a changed < \
<(git diff --name-only ${rev} -- \
<(git diff --name-only "${rev}" -- \
| grep "\.py$" \
| sed -e "s/\.py$/_test.py/" \
| sed -e "s/_test_test\.py$/_test.py/" \
Expand Down
4 changes: 2 additions & 2 deletions check/pytest-changed-files-and-incremental-coverage
Expand Up @@ -49,8 +49,8 @@ else
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
exit 1
fi
base="$(git merge-base ${rev} HEAD)"
if [ "$(git rev-parse ${rev})" == "${base}" ]; then
base="$(git merge-base "${rev}" HEAD)"
if [ "$(git rev-parse "${rev}")" == "${base}" ]; then
echo -e "Comparing against revision '${rev}'." >&2
else
echo -e "Comparing against revision '${rev}' (merge base ${base})." >&2
Expand Down

0 comments on commit 9fbaa05

Please sign in to comment.