Skip to content

Conversation

@hiroyuki-sato
Copy link
Collaborator

@hiroyuki-sato hiroyuki-sato commented Jun 4, 2025

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-actions
Copy link

github-actions bot commented Jun 4, 2025

⚠️ GitHub issue #46699 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting review Awaiting review label Jun 4, 2025
@kou
Copy link
Member

kou commented Jun 4, 2025

@github-actions crossbow submit -g cpp

@kou kou added the CI: Extra Run extra CI label Jun 4, 2025
@github-actions
Copy link

github-actions bot commented Jun 4, 2025

Revision: f195bb7

Submitted crossbow builds: ursacomputing/crossbow @ actions-6927c6452c

Task Status
example-cpp-minimal-build-static GitHub Actions
example-cpp-minimal-build-static-system-dependency GitHub Actions
example-cpp-tutorial GitHub Actions
test-alpine-linux-cpp GitHub Actions
test-build-cpp-fuzz GitHub Actions
test-conda-cpp GitHub Actions
test-conda-cpp-valgrind GitHub Actions
test-cuda-cpp-ubuntu-22.04-cuda-11.7.1 GitHub Actions
test-debian-12-cpp-amd64 GitHub Actions
test-debian-12-cpp-i386 GitHub Actions
test-fedora-39-cpp GitHub Actions
test-ubuntu-22.04-cpp GitHub Actions
test-ubuntu-22.04-cpp-20 GitHub Actions
test-ubuntu-22.04-cpp-bundled GitHub Actions
test-ubuntu-22.04-cpp-emscripten GitHub Actions
test-ubuntu-22.04-cpp-no-threading GitHub Actions
test-ubuntu-24.04-cpp GitHub Actions
test-ubuntu-24.04-cpp-bundled-offline GitHub Actions
test-ubuntu-24.04-cpp-gcc-13-bundled GitHub Actions
test-ubuntu-24.04-cpp-gcc-14 GitHub Actions
test-ubuntu-24.04-cpp-minimal-with-formats GitHub Actions
test-ubuntu-24.04-cpp-thread-sanitizer GitHub Actions

Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kou kou merged commit 23017e3 into apache:main Jun 5, 2025
35 of 37 checks passed
@kou kou removed the awaiting review Awaiting review label Jun 5, 2025
@github-actions github-actions bot added the awaiting merge Awaiting merge label Jun 5, 2025
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 23017e3.

There were 69 benchmark results with an error:

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.

@hiroyuki-sato hiroyuki-sato deleted the topic/shellcheck-cpp_test branch June 14, 2025 03:26
alinaliBQ pushed a commit to Bit-Quill/arrow that referenced this pull request Jun 17, 2025
…_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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge Awaiting merge CI: Extra Run extra CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants