Commit 0fbb9c5
apacheGH-46699: [CI][Dev] fix shellcheck errors in the ci/scripts/cpp_test.sh (apache#46700)
### Rationale for this change
`ci/scripts/cpp_test.sh` violates two shellcheck rules.
* SC2071: `< is for string comparisons. Use -lt instead.`
* SC2086: `Double quote to prevent globbing and word splitting.`
```
./ci/scripts/cpp_test.sh
In ./ci/scripts/cpp_test.sh line 22:
if [[ $# < 2 ]]; then
^-- SC2071 (error): < is for string comparisons. Use -lt instead.
In ./ci/scripts/cpp_test.sh line 87:
pushd ${build_dir}
^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
pushd "${build_dir}"
In ./ci/scripts/cpp_test.sh line 103:
--parallel ${n_jobs} \
^-------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
--parallel "${n_jobs}" \
In ./ci/scripts/cpp_test.sh line 105:
--timeout ${ARROW_CTEST_TIMEOUT:-300} \
^-------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
--timeout "${ARROW_CTEST_TIMEOUT:-300}" \
In ./ci/scripts/cpp_test.sh line 111:
examples=$(find ${binary_output_dir} -executable -name "*example")
^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
examples=$(find "${binary_output_dir}" -executable -name "*example")
In ./ci/scripts/cpp_test.sh line 129:
${binary_output_dir}/arrow-ipc-stream-fuzz ${ARROW_TEST_DATA}/arrow-ipc-stream/crash-*
^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${binary_output_dir}"/arrow-ipc-stream-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-stream/crash-*
In ./ci/scripts/cpp_test.sh line 130:
${binary_output_dir}/arrow-ipc-stream-fuzz ${ARROW_TEST_DATA}/arrow-ipc-stream/*-testcase-*
^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${binary_output_dir}"/arrow-ipc-stream-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-stream/*-testcase-*
In ./ci/scripts/cpp_test.sh line 131:
${binary_output_dir}/arrow-ipc-file-fuzz ${ARROW_TEST_DATA}/arrow-ipc-file/*-testcase-*
^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${binary_output_dir}"/arrow-ipc-file-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-file/*-testcase-*
In ./ci/scripts/cpp_test.sh line 132:
${binary_output_dir}/arrow-ipc-tensor-stream-fuzz ${ARROW_TEST_DATA}/arrow-ipc-tensor-stream/*-testcase-*
^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${binary_output_dir}"/arrow-ipc-tensor-stream-fuzz "${ARROW_TEST_DATA}"/arrow-ipc-tensor-stream/*-testcase-*
In ./ci/scripts/cpp_test.sh line 134:
${binary_output_dir}/parquet-arrow-fuzz ${ARROW_TEST_DATA}/parquet/fuzzing/*-testcase-*
^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
Did you mean:
"${binary_output_dir}"/parquet-arrow-fuzz "${ARROW_TEST_DATA}"/parquet/fuzzing/*-testcase-*
For more information:
https://www.shellcheck.net/wiki/SC2071 -- < is for string comparisons. Use ...
https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
```
### What changes are included in this PR?
* Use `-lt` instead of `<`
* Quote variables.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.
* GitHub Issue: apache#46699
Authored-by: Hiroyuki Sato <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>1 parent 809bfaf commit 0fbb9c5
2 files changed
+11
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
300 | 300 | | |
301 | 301 | | |
302 | 302 | | |
| 303 | + | |
303 | 304 | | |
304 | 305 | | |
305 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
| 111 | + | |
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
0 commit comments