Skip to content

Commit 6efe7b3

Browse files
GH-47402: [CI][Dev] Fix shellcheck errors in the ci/scripts/python_test_emscripten.sh (#47403)
### Rationale for this change This is the sub issue #44748. * SC2086: Double quote to prevent globbing and word splitting * SC2012: Use find instead of ls to better handle non-alphanumeric filenames ``` shellcheck ci/scripts/python_test_emscripten.sh In ci/scripts/python_test_emscripten.sh line 28: cd ${build_dir} ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cd "${build_dir}" In ci/scripts/python_test_emscripten.sh line 31: pyodide_wheel=$(ls -t dist/pyarrow*.whl | head -1) ^---------------------^ SC2012 (info): Use find instead of ls to better handle non-alphanumeric filenames. In ci/scripts/python_test_emscripten.sh line 34: python scripts/run_emscripten_tests.py ${pyodide_wheel} --dist-dir=${pyodide_dist_dir} --runtime=node ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: python scripts/run_emscripten_tests.py "${pyodide_wheel}" --dist-dir="${pyodide_dist_dir}" --runtime=node In ci/scripts/python_test_emscripten.sh line 37: python scripts/run_emscripten_tests.py ${pyodide_wheel} --dist-dir=${pyodide_dist_dir} --runtime=chrome ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: python scripts/run_emscripten_tests.py "${pyodide_wheel}" --dist-dir="${pyodide_dist_dir}" --runtime=chrome For more information: https://www.shellcheck.net/wiki/SC2012 -- Use find instead of ls to better ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ``` ### What changes are included in this PR? * SC2086: Quote variables. * SC2012: skip shellcheck. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #47402 Authored-by: Hiroyuki Sato <hiroysato@gmail.com> Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
1 parent 2482382 commit 6efe7b3

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ repos:
332332
?^ci/scripts/python_build\.sh$|
333333
?^ci/scripts/python_sdist_build\.sh$|
334334
?^ci/scripts/python_sdist_test\.sh$|
335+
?^ci/scripts/python_test_emscripten\.sh$|
335336
?^ci/scripts/python_wheel_unix_test\.sh$|
336337
?^ci/scripts/python_test_type_annotations\.sh$|
337338
?^ci/scripts/python_test\.sh$|

ci/scripts/python_test_emscripten.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@ set -ex
2525
build_dir=${1}/python
2626
pyodide_dist_dir=${2}
2727

28-
cd ${build_dir}
28+
cd "${build_dir}"
2929

3030
# note: this uses the newest wheel in dist
31+
# shellcheck disable=SC2012
3132
pyodide_wheel=$(ls -t dist/pyarrow*.whl | head -1)
3233

3334
echo "-------------- Running emscripten tests in Node ----------------------"
34-
python scripts/run_emscripten_tests.py ${pyodide_wheel} --dist-dir=${pyodide_dist_dir} --runtime=node
35+
python scripts/run_emscripten_tests.py "${pyodide_wheel}" --dist-dir="${pyodide_dist_dir}" --runtime=node
3536

3637
echo "-------------- Running emscripten tests in Chrome --------------------"
37-
python scripts/run_emscripten_tests.py ${pyodide_wheel} --dist-dir=${pyodide_dist_dir} --runtime=chrome
38+
python scripts/run_emscripten_tests.py "${pyodide_wheel}" --dist-dir="${pyodide_dist_dir}" --runtime=chrome
3839

0 commit comments

Comments
 (0)