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 e00c01a3fa GH-46763: [CI][Dev] fix shellcheck errors in the
ci/scripts/ccache_setup.sh (#46766)
e00c01a3fa is described below
commit e00c01a3fa4cc8ba098a637e3ba7e5ab5312cd0b
Author: Hiroyuki Sato <[email protected]>
AuthorDate: Thu Jun 12 14:00:31 2025 +0900
GH-46763: [CI][Dev] fix shellcheck errors in the ci/scripts/ccache_setup.sh
(#46766)
### Rationale for this change
This is the sub issue #44748.
* SC2086: (info): Double quote to prevent globbing and word splitting.
* SC2129: Consider using { cmd1; cmd2; } >> file instead of individual
redirects.
```
shellcheck ci/scripts/ccache_setup.sh
In ci/scripts/ccache_setup.sh line 22:
echo "ARROW_USE_CCACHE=ON" >> $GITHUB_ENV
^-- SC2129 (style): Consider using { cmd1; cmd2; } >> file instead of
individual redirects.
^---------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
echo "ARROW_USE_CCACHE=ON" >> "$GITHUB_ENV"
In ci/scripts/ccache_setup.sh line 23:
echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV
^---------^ SC2086 (info): Double
quote to prevent globbing and word splitting.
Did you mean:
echo "CCACHE_COMPILERCHECK=content" >> "$GITHUB_ENV"
In ci/scripts/ccache_setup.sh line 24:
echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
^---------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
echo "CCACHE_COMPRESS=1" >> "$GITHUB_ENV"
In ci/scripts/ccache_setup.sh line 25:
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
^---------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
echo "CCACHE_COMPRESSLEVEL=6" >> "$GITHUB_ENV"
In ci/scripts/ccache_setup.sh line 26:
echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
^---------^ SC2086 (info): Double quote to
prevent globbing and word splitting.
Did you mean:
echo "CCACHE_MAXSIZE=1G" >> "$GITHUB_ENV"
For more information:
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent
globbing ...
https://www.shellcheck.net/wiki/SC2129 -- Consider using { cmd1; cmd2; }
>>...
palolovalley:arrow hsato$ vi ci/scripts/ccache_setup.sh
```
### What changes are included in this PR?
* SC2086: Quoting like "$GITHUB_ENV"
* SC2129: combine multiple commands using `{}`
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: #46763
Authored-by: Hiroyuki Sato <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
---
.github/workflows/cpp.yml | 2 ++
.github/workflows/cpp_extra.yml | 2 ++
.github/workflows/ruby.yml | 2 ++
.pre-commit-config.yaml | 1 +
ci/scripts/ccache_setup.sh | 12 +++++++-----
5 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/cpp.yml b/.github/workflows/cpp.yml
index 8c4388fc0f..106cc1fd86 100644
--- a/.github/workflows/cpp.yml
+++ b/.github/workflows/cpp.yml
@@ -29,6 +29,7 @@ on:
- '.github/workflows/cpp.yml'
- 'ci/conda_env_*'
- 'ci/docker/**'
+ - 'ci/scripts/ccache_setup.sh'
- 'ci/scripts/cpp_*'
- 'ci/scripts/install_azurite.sh'
- 'ci/scripts/install_gcs_testbench.sh'
@@ -45,6 +46,7 @@ on:
- '.github/workflows/cpp.yml'
- 'ci/conda_env_*'
- 'ci/docker/**'
+ - 'ci/scripts/ccache_setup.sh'
- 'ci/scripts/cpp_*'
- 'ci/scripts/install_azurite.sh'
- 'ci/scripts/install_gcs_testbench.sh'
diff --git a/.github/workflows/cpp_extra.yml b/.github/workflows/cpp_extra.yml
index 3df63568e9..e982afde91 100644
--- a/.github/workflows/cpp_extra.yml
+++ b/.github/workflows/cpp_extra.yml
@@ -27,6 +27,7 @@ on:
- '.github/workflows/cpp_extra.yml'
- 'ci/conda_env_*'
- 'ci/docker/**'
+ - 'ci/scripts/ccache_setup.sh'
- 'ci/scripts/cpp_*'
- 'ci/scripts/install_azurite.sh'
- 'ci/scripts/install_gcs_testbench.sh'
@@ -45,6 +46,7 @@ on:
- '.github/workflows/cpp_extra.yml'
- 'ci/conda_env_*'
- 'ci/docker/**'
+ - 'ci/scripts/ccache_setup.sh'
- 'ci/scripts/cpp_*'
- 'ci/scripts/install_azurite.sh'
- 'ci/scripts/install_gcs_testbench.sh'
diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml
index 8cb16049f0..af52e73320 100644
--- a/.github/workflows/ruby.yml
+++ b/.github/workflows/ruby.yml
@@ -29,6 +29,7 @@ on:
- '.github/workflows/ruby.yml'
- 'ci/docker/**'
- 'ci/scripts/c_glib_*'
+ - 'ci/scripts/ccache_setup.sh'
- 'ci/scripts/cpp_*'
- 'ci/scripts/msys2_*'
- 'ci/scripts/ruby_*'
@@ -43,6 +44,7 @@ on:
- '.github/workflows/ruby.yml'
- 'ci/docker/**'
- 'ci/scripts/c_glib_*'
+ - 'ci/scripts/ccache_setup.sh'
- 'ci/scripts/cpp_*'
- 'ci/scripts/msys2_*'
- 'ci/scripts/ruby_*'
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 2d6d24c416..c3835ac0f1 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -299,6 +299,7 @@ repos:
?^c_glib/test/run-test\.sh$|
?^ci/scripts/c_glib_build\.sh$|
?^ci/scripts/c_glib_test\.sh$|
+ ?^ci/scripts/ccache_setup\.sh$|
?^ci/scripts/conan_build\.sh$|
?^ci/scripts/conan_setup\.sh$|
?^ci/scripts/cpp_test\.sh$|
diff --git a/ci/scripts/ccache_setup.sh b/ci/scripts/ccache_setup.sh
index 6afcdda7d0..df00efe702 100755
--- a/ci/scripts/ccache_setup.sh
+++ b/ci/scripts/ccache_setup.sh
@@ -19,8 +19,10 @@
set -eux
-echo "ARROW_USE_CCACHE=ON" >> $GITHUB_ENV
-echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV
-echo "CCACHE_COMPRESS=1" >> $GITHUB_ENV
-echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
-echo "CCACHE_MAXSIZE=1G" >> $GITHUB_ENV
+{
+ echo "ARROW_USE_CCACHE=ON"
+ echo "CCACHE_COMPILERCHECK=content"
+ echo "CCACHE_COMPRESS=1"
+ echo "CCACHE_COMPRESSLEVEL=6"
+ echo "CCACHE_MAXSIZE=1G"
+} >> "$GITHUB_ENV"