Skip to content

Conversation

@hiroyuki-sato
Copy link
Collaborator

@hiroyuki-sato hiroyuki-sato commented Aug 11, 2025

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

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

@github-actions github-actions bot added the awaiting review Awaiting review label Aug 11, 2025
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 0ae71f8 into apache:main Aug 12, 2025
15 checks passed
@kou kou removed the awaiting review Awaiting review label Aug 12, 2025
@github-actions github-actions bot added the awaiting merge Awaiting merge label Aug 12, 2025
@hiroyuki-sato hiroyuki-sato deleted the topic/shellcheck-python_build branch August 13, 2025 00:15
@conbench-apache-arrow
Copy link

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

There weren't enough matching historic benchmark results to make a call on whether there were regressions.

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge Awaiting merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants