From b12551b94d2c8fd192dff7585991ed7530ac1f94 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Fri, 14 Aug 2026 11:28:59 +0900 Subject: [PATCH 1/4] GH-50860: [Dev][R][Swift] Simplify pre-commit file patterns for the r and swift directories --- .pre-commit-config.yaml | 4 +--- r/inst/build_arrow_static.sh | 2 +- r/tools/download_dependencies_R.sh | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1277ad09f661..9b4d74a1980e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -321,9 +321,7 @@ repos: ?^dev/release/setup-rhel-rebuilds\.sh$| ?^dev/release/utils-generate-checksum\.sh$| ?^dev/release/utils-watch-gh-workflow\.sh$| - ?^r/tools/download_dependencies_R\.sh$| - ?^r/inst/build_arrow_static\.sh$| - ?^swift/gen-protobuffers\.sh$| + ?^r/.*\.sh$| ) - repo: https://github.com/scop/pre-commit-shfmt # v3.11.0-1 or later requires pre-commit 3.2.0 or later but Ubuntu diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh index 34a607cfb6f7..42ababee8967 100755 --- a/r/inst/build_arrow_static.sh +++ b/r/inst/build_arrow_static.sh @@ -26,7 +26,7 @@ set -x # By default, this script assumes it's in the top-level dir of the apache/arrow # git repository. Set any of the following env vars to customize where to read # and write from -: "${ARROW_HOME:=$(pwd)}" # Only used in default SOURCE/BUILD dirs +: ${ARROW_HOME:=$(pwd)} # Only used in default SOURCE/BUILD dirs : "${SOURCE_DIR:=${ARROW_HOME}/cpp}" # Where the C++ source is : "${BUILD_DIR:=${ARROW_HOME}/r/libarrow/dist}" # Where cmake should build : "${DEST_DIR:=$BUILD_DIR}" # Where the resulting /lib and /include should be diff --git a/r/tools/download_dependencies_R.sh b/r/tools/download_dependencies_R.sh index c5a0b96ca9a4..9821c3224d21 100755 --- a/r/tools/download_dependencies_R.sh +++ b/r/tools/download_dependencies_R.sh @@ -38,7 +38,7 @@ if [ "$#" -ne 1 ]; then else run_mode="download_dependency" DESTDIR=$1 - mkdir -p "${DESTDIR}" + mkdir -p ${DESTDIR} fi download_dependency() { From 5a7997058c69e0bc59ca8246e0aa3aa72d728f0c Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Fri, 14 Aug 2026 11:45:25 +0900 Subject: [PATCH 2/4] Revert shellcheck errors in r --- r/inst/build_arrow_static.sh | 2 +- r/tools/download_dependencies_R.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh index 42ababee8967..34a607cfb6f7 100755 --- a/r/inst/build_arrow_static.sh +++ b/r/inst/build_arrow_static.sh @@ -26,7 +26,7 @@ set -x # By default, this script assumes it's in the top-level dir of the apache/arrow # git repository. Set any of the following env vars to customize where to read # and write from -: ${ARROW_HOME:=$(pwd)} # Only used in default SOURCE/BUILD dirs +: "${ARROW_HOME:=$(pwd)}" # Only used in default SOURCE/BUILD dirs : "${SOURCE_DIR:=${ARROW_HOME}/cpp}" # Where the C++ source is : "${BUILD_DIR:=${ARROW_HOME}/r/libarrow/dist}" # Where cmake should build : "${DEST_DIR:=$BUILD_DIR}" # Where the resulting /lib and /include should be diff --git a/r/tools/download_dependencies_R.sh b/r/tools/download_dependencies_R.sh index 9821c3224d21..c5a0b96ca9a4 100755 --- a/r/tools/download_dependencies_R.sh +++ b/r/tools/download_dependencies_R.sh @@ -38,7 +38,7 @@ if [ "$#" -ne 1 ]; then else run_mode="download_dependency" DESTDIR=$1 - mkdir -p ${DESTDIR} + mkdir -p "${DESTDIR}" fi download_dependency() { From 23b8892836009d1c48b61b2701674932a510b432 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Fri, 14 Aug 2026 11:46:15 +0900 Subject: [PATCH 3/4] Use wildcard ShellCheck for c_glib dir --- .pre-commit-config.yaml | 2 +- c_glib/test/run-test.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9b4d74a1980e..9a38aef88d0f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -291,7 +291,7 @@ repos: # TODO: Remove this when we fix all lint failures files: >- ( - ?^c_glib/test/run-test\.sh$| + ?^c_glib/.*\.sh$| ?^ci/.*\.sh$| ?^cpp/build-support/build-lz4-lib\.sh$| ?^cpp/build-support/build-zstd-lib\.sh$| diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index 8b1868942073..0cda50afa4ad 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -30,7 +30,7 @@ modules=( parquet-glib ) -for module in "${modules[@]}"; do +for module in ${modules[@]}; do module_build_dir="${build_dir}/${module}" if [ -d "${module_build_dir}" ]; then LD_LIBRARY_PATH="${module_build_dir}:${LD_LIBRARY_PATH}" From 61e00ec1de2ab4bde331ace16bc500db2f5e6422 Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Fri, 14 Aug 2026 12:03:33 +0900 Subject: [PATCH 4/4] Revert shellcheck errors in c_glib --- c_glib/test/run-test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c_glib/test/run-test.sh b/c_glib/test/run-test.sh index 0cda50afa4ad..8b1868942073 100755 --- a/c_glib/test/run-test.sh +++ b/c_glib/test/run-test.sh @@ -30,7 +30,7 @@ modules=( parquet-glib ) -for module in ${modules[@]}; do +for module in "${modules[@]}"; do module_build_dir="${build_dir}/${module}" if [ -d "${module_build_dir}" ]; then LD_LIBRARY_PATH="${module_build_dir}:${LD_LIBRARY_PATH}"