Skip to content

Commit eda392c

Browse files
GH-47125: [CI][Dev] Fix shellcheck errors in the ci/scripts/integration_hdfs.sh (#47126)
### Rationale for this change This is the sub issue #44748. * SC2034: source_dir appears unused. Verify use (or export if used externally). * SC2086: Double quote to prevent globbing and word splitting. * SC2155: Declare and assign separately to avoid masking return values. ``` shellcheck ci/scripts/integration_hdfs.sh In ci/scripts/integration_hdfs.sh line 22: source_dir=${1}/cpp ^--------^ SC2034 (warning): source_dir appears unused. Verify use (or export if used externally). In ci/scripts/integration_hdfs.sh line 25: export CLASSPATH=$($HADOOP_HOME/bin/hadoop classpath --glob) ^-------^ SC2155 (warning): Declare and assign separately to avoid masking return values. ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: export CLASSPATH=$("$HADOOP_HOME"/bin/hadoop classpath --glob) In ci/scripts/integration_hdfs.sh line 45: pushd ${build_dir} ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "${build_dir}" For more information: https://www.shellcheck.net/wiki/SC2034 -- source_dir appears unused. Verify... https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... ``` ### What changes are included in this PR? * SC2034: disable shellcheck * SC2086: Quote variables. * SC2155: separate variable declaration and export. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * GitHub Issue: #47125 Authored-by: Hiroyuki Sato <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
1 parent 84e3341 commit eda392c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ repos:
331331
?^ci/scripts/integration_arrow_build\.sh$|
332332
?^ci/scripts/integration_arrow\.sh$|
333333
?^ci/scripts/integration_dask\.sh$|
334+
?^ci/scripts/integration_hdfs\.sh$|
334335
?^ci/scripts/integration_spark\.sh$|
335336
?^ci/scripts/matlab_build\.sh$|
336337
?^ci/scripts/msys2_system_clean\.sh$|

ci/scripts/integration_hdfs.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919

2020
set -e
2121

22+
# shellcheck disable=SC2034
2223
source_dir=${1}/cpp
2324
build_dir=${2}/cpp
2425

25-
export CLASSPATH=$($HADOOP_HOME/bin/hadoop classpath --glob)
26+
HADOOP_CLASSPATH=$("$HADOOP_HOME/bin/hadoop" classpath --glob)
27+
export CLASSPATH="${HADOOP_CLASSPATH}"
2628
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
2729
export LIBHDFS3_CONF=$HADOOP_CONF_DIR/hdfs-site.xml
2830
export ARROW_LIBHDFS3_DIR=$CONDA_PREFIX/lib
@@ -42,7 +44,7 @@ function use_libhdfs_dir() {
4244

4345
# execute cpp tests
4446
export ARROW_HDFS_TEST_LIBHDFS_REQUIRE=ON
45-
pushd ${build_dir}
47+
pushd "${build_dir}"
4648

4749
debug/arrow-io-hdfs-test
4850
debug/arrow-hdfs-test

0 commit comments

Comments
 (0)