Skip to content

Commit 90394dd

Browse files
committed
GH-50777: [CI][Dev] Fix shellcheck errors in the ci/scripts/r_test.sh
1 parent 8e63098 commit 90394dd

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ repos:
344344
?^ci/scripts/r_install_system_dependencies\.sh$|
345345
?^ci/scripts/r_revdepcheck\.sh$|
346346
?^ci/scripts/r_sanitize\.sh$|
347+
?^ci/scripts/r_test\.sh$|
347348
?^ci/scripts/release_test\.sh$|
348349
?^ci/scripts/ruby_test\.sh$|
349350
?^ci/scripts/rust_build\.sh$|

ci/scripts/r_test.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,19 @@
1818

1919
set -ex
2020

21-
: ${R_BIN:=R}
21+
: "${R_BIN:=R}"
2222

23-
source_dir=${1}/r
23+
source_dir="${1}/r"
2424

25-
pushd ${source_dir}
25+
pushd "${source_dir}"
2626

2727
printenv
2828

2929
if [ -n "${ARROW_PYTHON_VENV:-}" ]; then
30+
# We don't need to follow this external file.
31+
# See also: https://www.shellcheck.net/wiki/SC1091
32+
#
33+
# shellcheck source=/dev/null
3034
. "${ARROW_PYTHON_VENV}/bin/activate"
3135
fi
3236

@@ -47,8 +51,8 @@ if [ "$ARROW_R_FORCE_TESTS" = "true" ]; then
4751
fi
4852

4953
if [ "$ARROW_USE_PKG_CONFIG" != "false" ]; then
50-
export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH}
51-
export R_LD_LIBRARY_PATH=${LD_LIBRARY_PATH}
54+
export LD_LIBRARY_PATH="${ARROW_HOME}/lib:${LD_LIBRARY_PATH}"
55+
export R_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}"
5256
fi
5357

5458
export _R_CHECK_COMPILATION_FLAGS_KNOWN_="${_R_CHECK_COMPILATION_FLAGS_KNOWN_} ${ARROW_R_CXXFLAGS}"
@@ -126,7 +130,7 @@ SCRIPT="as_cran <- !identical(tolower(Sys.getenv('NOT_CRAN')), 'true')
126130
print(args)
127131
128132
rcmdcheck::rcmdcheck(build_args = build_args, args = args, error_on = 'warning', check_dir = 'check', timeout = 3600)"
129-
echo "$SCRIPT" | ${R_BIN} --no-save
133+
echo "$SCRIPT" | "${R_BIN}" --no-save
130134

131135
AFTER=$(ls -alh ~/)
132136
if [ "$NOT_CRAN" != "true" ] && [ "$BEFORE" != "$AFTER" ]; then

0 commit comments

Comments
 (0)