Commit 0ae71f8
authored
### Rationale for this change
This is the sub issue #44748.
* SC1091: Not following: ./bin/activate: openBinaryFile: does not exist
* SC2034: foo appears unused
* SC2086: Double quote to prevent globbing and word splitting
* SC2223: This default assignment may cause DoS due to globbing. Quote it.
* SC2236: Use `-n` instead of `! -z`
```
shellcheck ci/scripts/python_build.sh
In ci/scripts/python_build.sh line 28:
: ${BUILD_DOCS_PYTHON:=OFF}
^-----------------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.
In ci/scripts/python_build.sh line 31:
git config --global --add safe.directory ${arrow_dir}
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
git config --global --add safe.directory "${arrow_dir}"
In ci/scripts/python_build.sh line 35:
. "${ARROW_PYTHON_VENV}/bin/activate"
^-- SC1091 (info): Not following: ./bin/activate: openBinaryFile: does not exist (No such file or directory)
In ci/scripts/python_build.sh line 53:
if [ ! -z "${CONDA_PREFIX}" ]; then
^-- SC2236 (style): Use -n instead of ! -z.
In ci/scripts/python_build.sh line 77:
: ${CMAKE_PREFIX_PATH:=${ARROW_HOME}}
^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it.
In ci/scripts/python_build.sh line 85:
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.sh line 86:
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.sh line 87:
pushd ${python_build_dir}
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pushd "${python_build_dir}"
In ci/scripts/python_build.sh line 101:
rm -rf ${python_build_dir}/docs/source
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
rm -rf "${python_build_dir}"/docs/source
In ci/scripts/python_build.sh line 102:
mkdir -p ${python_build_dir}/docs
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
mkdir -p "${python_build_dir}"/docs
In ci/scripts/python_build.sh line 103:
cp -a ${arrow_dir}/docs/source ${python_build_dir}/docs/
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
cp -a "${arrow_dir}"/docs/source "${python_build_dir}"/docs/
In ci/scripts/python_build.sh line 104:
rm -rf ${python_build_dir}/format
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
rm -rf "${python_build_dir}"/format
In ci/scripts/python_build.sh line 105:
cp -a ${arrow_dir}/format ${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 -a "${arrow_dir}"/format "${python_build_dir}"/
In ci/scripts/python_build.sh line 106:
rm -rf ${python_build_dir}/cpp/examples
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
rm -rf "${python_build_dir}"/cpp/examples
In ci/scripts/python_build.sh line 107:
mkdir -p ${python_build_dir}/cpp
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
mkdir -p "${python_build_dir}"/cpp
In ci/scripts/python_build.sh line 108:
cp -a ${arrow_dir}/cpp/examples ${python_build_dir}/cpp/
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
cp -a "${arrow_dir}"/cpp/examples "${python_build_dir}"/cpp/
In ci/scripts/python_build.sh line 109:
rm -rf ${python_build_dir}/ci
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
rm -rf "${python_build_dir}"/ci
In ci/scripts/python_build.sh line 110:
cp -a ${arrow_dir}/ci/ ${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 -a "${arrow_dir}"/ci/ "${python_build_dir}"/
In ci/scripts/python_build.sh line 111:
ncpus=$(python -c "import os; print(os.cpu_count())")
^---^ SC2034 (warning): ncpus appears unused. Verify use (or export if used externally).
In ci/scripts/python_build.sh line 113:
pushd ${build_dir}
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pushd "${build_dir}"
In ci/scripts/python_build.sh line 116:
${python_build_dir}/docs/source \
^-----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${python_build_dir}"/docs/source \
In ci/scripts/python_build.sh line 117:
${build_dir}/docs
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${build_dir}"/docs
For more information:
https://www.shellcheck.net/wiki/SC2034 -- ncpus appears unused. Verify use ...
https://www.shellcheck.net/wiki/SC1091 -- Not following: ./bin/activate: op...
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
```
### What changes are included in this PR?
* SC1091: Skip file check
* SC2034: remove the variable
* SC2086: Quote variables
* SC2223: Quote variables
* SC2236: Use `-n` instead of `! -z`
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: #47306
Authored-by: Hiroyuki Sato <hiroysato@gmail.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent ac99056 commit 0ae71f8
2 files changed
+25
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
53 | | - | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
| |||
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
77 | | - | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
84 | 88 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
98 | 102 | | |
99 | 103 | | |
100 | 104 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
112 | 115 | | |
113 | | - | |
| 116 | + | |
114 | 117 | | |
115 | 118 | | |
116 | | - | |
117 | | - | |
| 119 | + | |
| 120 | + | |
118 | 121 | | |
119 | 122 | | |
0 commit comments