This is an automated email from the ASF dual-hosted git repository.

assignuser 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 4c2aef7b23 GH-44749: [CI][Dev] Apply ShellCheck lint to 
ci/scripts/c_glib_test.sh (#44750)
4c2aef7b23 is described below

commit 4c2aef7b231f129db7b3bdb232c6da00542ba7b3
Author: Sutou Kouhei <[email protected]>
AuthorDate: Mon Nov 18 09:46:25 2024 +0900

    GH-44749: [CI][Dev] Apply ShellCheck lint to ci/scripts/c_glib_test.sh 
(#44750)
    
    ### Rationale for this change
    
    ```console
    $ pre-commit run --show-diff-on-failure --color=always --all-files 
shellcheck
    ShellCheck 
v0.10.0.......................................................Failed
    - hook id: shellcheck
    - exit code: 1
    
    In ci/scripts/c_glib_test.sh line 25:
    : ${ARROW_GLIB_VAPI:=true}
      ^----------------------^ SC2223 (info): This default assignment may cause 
DoS due to globbing. Quote it.
    
    In ci/scripts/c_glib_test.sh line 37:
    pushd ${source_dir}
          ^-----------^ SC2086 (info): Double quote to prevent globbing and 
word splitting.
    
    Did you mean:
    pushd "${source_dir}"
    
    In ci/scripts/c_glib_test.sh line 54:
    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/SC2086 -- Double quote to prevent 
globbing ...
      https://www.shellcheck.net/wiki/SC2223 -- This default assignment may 
cause...
    ```
    
    ### What changes are included in this PR?
    
    * Add missing quotes.
    
    ### Are these changes tested?
    
    Yes.
    
    ### Are there any user-facing changes?
    
    No.
    * GitHub Issue: #44749
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Jacob Wujciak-Jens <[email protected]>
---
 .pre-commit-config.yaml   | 1 +
 ci/scripts/c_glib_test.sh | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index e9d7f28fa6..6bde1cb296 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -181,4 +181,5 @@ repos:
         files: >-
           (
           ?^ci/scripts/c_glib_build\.sh$|
+          ?^ci/scripts/c_glib_test\.sh$|
           )
diff --git a/ci/scripts/c_glib_test.sh b/ci/scripts/c_glib_test.sh
index 02753872dc..19131709e2 100755
--- a/ci/scripts/c_glib_test.sh
+++ b/ci/scripts/c_glib_test.sh
@@ -22,7 +22,7 @@ set -ex
 source_dir=${1}/c_glib
 build_dir=${2}/c_glib
 
-: ${ARROW_GLIB_VAPI:=true}
+: "${ARROW_GLIB_VAPI:=true}"
 
 export DYLD_LIBRARY_PATH=${ARROW_HOME}/lib:${DYLD_LIBRARY_PATH}
 export LD_LIBRARY_PATH=${ARROW_HOME}/lib:${LD_LIBRARY_PATH}
@@ -34,7 +34,7 @@ if [ -z "${ARROW_DEBUG_MEMORY_POOL}" ]; then
   export ARROW_DEBUG_MEMORY_POOL=trap
 fi
 
-pushd ${source_dir}
+pushd "${source_dir}"
 
 ruby test/run-test.rb
 
@@ -51,7 +51,7 @@ fi
 
 popd
 
-pushd ${build_dir}
+pushd "${build_dir}"
 example/build
 example/extension-type
 if [ "${ARROW_GLIB_VAPI}" = "true" ]; then

Reply via email to