This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 8ef974c3a1 GH-47289: [CI][Dev] Fix shellcheck errors in the
ci/scripts/python_build_emscripten.sh (#47290)
8ef974c3a1 is described below
commit 8ef974c3a16ad1a9d6f90ad967dc8a434ac2d450
Author: Hiroyuki Sato <[email protected]>
AuthorDate: Mon Aug 11 05:54:57 2025 +0900
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]>
---
.pre-commit-config.yaml | 1 +
ci/scripts/python_build_emscripten.sh | 11 +++++++----
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e703474e3e..a6a0e5717e 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -338,6 +338,7 @@ repos:
?^ci/scripts/msys2_system_clean\.sh$|
?^ci/scripts/msys2_system_upgrade\.sh$|
?^ci/scripts/nanoarrow_build\.sh$|
+ ?^ci/scripts/python_build_emscripten\.sh$|
?^ci/scripts/python_sdist_build\.sh$|
?^ci/scripts/python_wheel_unix_test\.sh$|
?^ci/scripts/r_build\.sh$|
diff --git a/ci/scripts/python_build_emscripten.sh
b/ci/scripts/python_build_emscripten.sh
index 14e9626202..857c0e2513 100755
--- a/ci/scripts/python_build_emscripten.sh
+++ b/ci/scripts/python_build_emscripten.sh
@@ -22,19 +22,22 @@ set -ex
arrow_dir=${1}
build_dir=${2}
-
+# We don't need to follow this external file.
+# See also: https://www.shellcheck.net/wiki/SC1090
+#
+# shellcheck source=/dev/null
source ~/emsdk/emsdk_env.sh
source_dir=${arrow_dir}/python
python_build_dir=${build_dir}/python
-rm -rf ${python_build_dir}
-cp -aL ${source_dir} ${python_build_dir}
+rm -rf "${python_build_dir}"
+cp -aL "${source_dir}" "${python_build_dir}"
# conda sets LDFLAGS / CFLAGS etc. which break
# emcmake so we unset them
unset LDFLAGS CFLAGS CXXFLAGS CPPFLAGS
-pushd ${python_build_dir}
+pushd "${python_build_dir}"
pyodide build
popd