Skip to content

Commit 8ef974c

Browse files
GH-47289: [CI][Dev] Fix shellcheck errors in the ci/scripts/python_build_emscripten.sh (#47290)
### Rationale for this change * SC1090: Can't follow non-constant source. Use a directive to specify location * SC2086: Double quote to prevent globbing and word splitting ``` In ci/scripts/python_build_emscripten.sh line 26: source ~/emsdk/emsdk_env.sh ^------------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location. In ci/scripts/python_build_emscripten.sh line 31: rm -rf ${python_build_dir} ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf "${python_build_dir}" In ci/scripts/python_build_emscripten.sh line 32: cp -aL ${source_dir} ${python_build_dir} ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cp -aL "${source_dir}" "${python_build_dir}" In ci/scripts/python_build_emscripten.sh line 38: pushd ${python_build_dir} ^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "${python_build_dir}" For more information: https://www.shellcheck.net/wiki/SC1090 -- ShellCheck can't follow non-const... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ``` ### What changes are included in this PR? * SC1090: disable source file check. * SC2086: Quote variables. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #47289 Authored-by: Hiroyuki Sato <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 135357c commit 8ef974c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ repos:
338338
?^ci/scripts/msys2_system_clean\.sh$|
339339
?^ci/scripts/msys2_system_upgrade\.sh$|
340340
?^ci/scripts/nanoarrow_build\.sh$|
341+
?^ci/scripts/python_build_emscripten\.sh$|
341342
?^ci/scripts/python_sdist_build\.sh$|
342343
?^ci/scripts/python_wheel_unix_test\.sh$|
343344
?^ci/scripts/r_build\.sh$|

ci/scripts/python_build_emscripten.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,22 @@ set -ex
2222
arrow_dir=${1}
2323
build_dir=${2}
2424

25-
25+
# We don't need to follow this external file.
26+
# See also: https://www.shellcheck.net/wiki/SC1090
27+
#
28+
# shellcheck source=/dev/null
2629
source ~/emsdk/emsdk_env.sh
2730

2831
source_dir=${arrow_dir}/python
2932
python_build_dir=${build_dir}/python
3033

31-
rm -rf ${python_build_dir}
32-
cp -aL ${source_dir} ${python_build_dir}
34+
rm -rf "${python_build_dir}"
35+
cp -aL "${source_dir}" "${python_build_dir}"
3336

3437
# conda sets LDFLAGS / CFLAGS etc. which break
3538
# emcmake so we unset them
3639
unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS
3740

38-
pushd ${python_build_dir}
41+
pushd "${python_build_dir}"
3942
pyodide build
4043
popd

0 commit comments

Comments
 (0)