mirror of
https://github.com/apache/arrow.git
synced 2026-10-28 08:35:46 +08:00
### Rationale for this change This is the sub issue #44748. * SC2046: Quote this to prevent word splitting * SC2086: Double quote to prevent globbing and word splitting * SC2223: This default assignment may cause DoS due to globbing. Quote it ``` In build_arrow.sh line 23: mkdir -p $ARROW_BUILD_DIR ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mkdir -p "$ARROW_BUILD_DIR" In build_arrow.sh line 24: pushd $ARROW_BUILD_DIR ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "$ARROW_BUILD_DIR" In build_arrow.sh line 30: $ARROW_CMAKE_OPTIONS ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$ARROW_CMAKE_OPTIONS" In build_arrow.sh line 32: make -j$NPROC ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make -j"$NPROC" In build_example.sh line 21: mkdir -p $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mkdir -p "$EXAMPLE_BUILD_DIR" In build_example.sh line 22: pushd $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "$EXAMPLE_BUILD_DIR" In run_static.sh line 21: : ${ARROW_DIR:=/arrow} ^------------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. In run_static.sh line 22: : ${EXAMPLE_DIR:=/io} ^-----------------^ SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. In run_static.sh line 23: : ${ARROW_BUILD_DIR:=/build/arrow} ^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. In run_static.sh line 24: : ${EXAMPLE_BUILD_DIR:=/build/example} ^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. In run_static.sh line 26: : ${ARROW_DEPENDENCY_SOURCE:=BUNDLED} ^-- SC2223 (info): This default assignment may cause DoS due to globbing. Quote it. In run_static.sh line 34: mkdir -p $ARROW_BUILD_DIR ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mkdir -p "$ARROW_BUILD_DIR" In run_static.sh line 35: pushd $ARROW_BUILD_DIR ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "$ARROW_BUILD_DIR" In run_static.sh line 39: cmake $ARROW_DIR/cpp \ ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cmake "$ARROW_DIR"/cpp \ In run_static.sh line 43: -DARROW_DEPENDENCY_SOURCE=${ARROW_DEPENDENCY_SOURCE} \ ^------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: -DARROW_DEPENDENCY_SOURCE="${ARROW_DEPENDENCY_SOURCE}" \ In run_static.sh line 46: $ARROW_CMAKE_OPTIONS ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$ARROW_CMAKE_OPTIONS" In run_static.sh line 48: make -j$NPROC ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: make -j"$NPROC" In run_static.sh line 60: rm -rf $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf "$EXAMPLE_BUILD_DIR" In run_static.sh line 61: mkdir -p $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mkdir -p "$EXAMPLE_BUILD_DIR" In run_static.sh line 62: pushd $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "$EXAMPLE_BUILD_DIR" In run_static.sh line 64: cmake $EXAMPLE_DIR -DARROW_LINK_SHARED=OFF ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: cmake "$EXAMPLE_DIR" -DARROW_LINK_SHARED=OFF In run_static.sh line 76: pushd $EXAMPLE_DIR ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "$EXAMPLE_DIR" In run_static.sh line 78: $EXAMPLE_BUILD_DIR/arrow-example ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$EXAMPLE_BUILD_DIR"/arrow-example In run_static.sh line 87: rm -rf $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: rm -rf "$EXAMPLE_BUILD_DIR" In run_static.sh line 88: mkdir -p $EXAMPLE_BUILD_DIR ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: mkdir -p "$EXAMPLE_BUILD_DIR" In run_static.sh line 90: -o $EXAMPLE_BUILD_DIR/arrow-example \ ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: -o "$EXAMPLE_BUILD_DIR"/arrow-example \ In run_static.sh line 91: $EXAMPLE_DIR/example.cc \ ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$EXAMPLE_DIR"/example.cc \ In run_static.sh line 92: $(PKG_CONFIG_PATH=$ARROW_BUILD_DIR/lib/pkgconfig \ ^-- SC2046 (warning): Quote this to prevent word splitting. In run_static.sh line 104: pushd $EXAMPLE_DIR ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: pushd "$EXAMPLE_DIR" In run_static.sh line 106: $EXAMPLE_BUILD_DIR/arrow-example ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "$EXAMPLE_BUILD_DIR"/arrow-example For more information: https://www.shellcheck.net/wiki/SC2046 -- Quote this to prevent word splitt... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... https://www.shellcheck.net/wiki/SC2223 -- This default assignment may cause... ``` ### What changes are included in this PR? * SC2046: Quote command substitutions * SC2086: Quote variables * SC2223: Quote default assignments ### Are these changes tested? Yes. ### Are there any user-facing changes? No. ### Was AI used for this PR? In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [x] Human - [ ] AI **Reviewed before submission by:** - [x] Human - [ ] AI - [ ] Not reviewed * GitHub Issue: #51670 Authored-by: Hiroyuki Sato <hiroysato@gmail.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
343 lines
9.7 KiB
YAML
343 lines
9.7 KiB
YAML
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
# To use this, install the python package `pre-commit` and
|
|
# run once `pre-commit install`. This will setup a git pre-commit-hook
|
|
# that is executed on each commit and will report the linting problems.
|
|
# To run all hooks on all files use `pre-commit run -a`
|
|
|
|
repos:
|
|
- repo: local
|
|
hooks:
|
|
- id: rat
|
|
name: Release Audit Tool
|
|
language: system
|
|
entry: |
|
|
bash -c " \
|
|
git archive HEAD \
|
|
--prefix=apache-arrow/ \
|
|
--output=apache-arrow.tar.gz && \
|
|
dev/release/run-rat.sh apache-arrow.tar.gz && \
|
|
rm -f apache-arrow.tar.gz"
|
|
always_run: true
|
|
pass_filenames: false
|
|
- repo: https://github.com/hadolint/hadolint
|
|
rev: v2.12.0
|
|
hooks:
|
|
- id: hadolint-docker
|
|
alias: docker
|
|
name: Docker Format
|
|
# We can enable this after we fix all existing lint failures.
|
|
# files: (/Dockerfile|\.dockerfile)$
|
|
files: >-
|
|
(
|
|
?^ci/docker/conda-python-emscripten\.dockerfile$|
|
|
?^ci/docker/python-.*-wheel-windows-test-vs2022.*\.dockerfile$|
|
|
)
|
|
types: []
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: v18.1.8
|
|
hooks:
|
|
- id: clang-format
|
|
name: C++ Format
|
|
alias: cpp
|
|
types_or:
|
|
- c++
|
|
# - json
|
|
# - proto
|
|
files: >-
|
|
^cpp/
|
|
exclude: >-
|
|
(
|
|
?\.grpc\.fb\.(cc|h)$|
|
|
?\.pb\.(cc|h)$|
|
|
?_generated.*\.(cc|h)$|
|
|
?^cpp/src/arrow/vendored/|
|
|
?^cpp/src/generated/|
|
|
?^cpp/thirdparty/|
|
|
)
|
|
- repo: https://github.com/cpplint/cpplint
|
|
rev: 1.6.1
|
|
hooks:
|
|
- id: cpplint
|
|
alias: cpp
|
|
name: C++ Lint
|
|
args:
|
|
- "--quiet"
|
|
- "--verbose=2"
|
|
types_or:
|
|
- c++
|
|
files: >-
|
|
^cpp/
|
|
exclude: >-
|
|
(
|
|
?\.grpc\.fb\.(cc|h)$|
|
|
?\.pb\.(cc|h)$|
|
|
?_generated.*\.(cc|h)$|
|
|
?^cpp/src/arrow/vendored/|
|
|
?^cpp/src/generated/|
|
|
?^cpp/thirdparty/|
|
|
)
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: v18.1.8
|
|
hooks:
|
|
- id: clang-format
|
|
alias: c-glib
|
|
name: C/GLib Format
|
|
files: >-
|
|
^c_glib/
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: v18.1.8
|
|
hooks:
|
|
- id: clang-format
|
|
name: MATLAB (C++) Format
|
|
alias: matlab-cpp-format
|
|
files: >-
|
|
^matlab/src/cpp/
|
|
- repo: https://github.com/hhatto/autopep8
|
|
rev: v2.3.2
|
|
hooks:
|
|
- id: autopep8
|
|
alias: python
|
|
name: Python Format
|
|
args:
|
|
- "--global-config"
|
|
- "python/setup.cfg"
|
|
- "--ignore-local-config"
|
|
- "--in-place"
|
|
files: >-
|
|
^(c_glib|dev|python)/
|
|
types:
|
|
- file
|
|
types_or:
|
|
- cython
|
|
- python
|
|
exclude: >-
|
|
(
|
|
?^python/pyarrow/vendored/|
|
|
)
|
|
- repo: https://github.com/pycqa/flake8
|
|
rev: 6.1.0
|
|
hooks:
|
|
- id: flake8
|
|
alias: python
|
|
name: Python Lint
|
|
args:
|
|
- "--config"
|
|
- "python/setup.cfg"
|
|
files: >-
|
|
^(c_glib|dev|python)/
|
|
exclude: >-
|
|
(
|
|
?^python/pyarrow/vendored/|
|
|
)
|
|
- repo: https://github.com/MarcoGorelli/cython-lint
|
|
rev: v0.21.1
|
|
hooks:
|
|
- id: cython-lint
|
|
alias: python
|
|
name: Python (Cython) Lint
|
|
args:
|
|
- "--no-pycodestyle"
|
|
files: >-
|
|
^python/
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: v18.1.8
|
|
hooks:
|
|
- id: clang-format
|
|
alias: python
|
|
name: Python (C++) Format
|
|
files: >-
|
|
^python/pyarrow/src/
|
|
exclude: >-
|
|
(
|
|
?\.grpc\.fb\.(cc|h)$|
|
|
?.pb\.(cc|h)$|
|
|
?^cpp/src/generated/|
|
|
)
|
|
- repo: https://github.com/numpy/numpydoc
|
|
rev: v1.8.0
|
|
hooks:
|
|
- id: numpydoc-validation
|
|
name: Python (NumPy doc) Lint
|
|
alias: python-doc-lint
|
|
args:
|
|
- "--config=python"
|
|
files: >-
|
|
^python/pyarrow/
|
|
exclude: >-
|
|
(
|
|
?^python/pyarrow/interchange/from_dataframe\.py$|
|
|
?^python/pyarrow/jvm\.py$|
|
|
?^python/pyarrow/pandas_compat\.py$|
|
|
?^python/pyarrow/tests/|
|
|
?^python/pyarrow/util\.py$|
|
|
?^python/pyarrow/vendored/|
|
|
)
|
|
- repo: https://github.com/etiennebacher/jarl-pre-commit
|
|
rev: "0.5.0"
|
|
hooks:
|
|
- id: jarl-check
|
|
alias: r
|
|
name: R Lint (jarl)
|
|
- repo: https://github.com/posit-dev/air-pre-commit
|
|
rev: 0.8.2
|
|
hooks:
|
|
- id: air-format
|
|
alias: r
|
|
name: R Format (Air)
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
rev: v18.1.8
|
|
hooks:
|
|
- id: clang-format
|
|
alias: r
|
|
name: R (C++) Format
|
|
files: >-
|
|
^r/src/
|
|
exclude: >-
|
|
(
|
|
?^r/src/arrowExports\.cpp$|
|
|
)
|
|
- repo: https://github.com/cpplint/cpplint
|
|
rev: 1.6.1
|
|
hooks:
|
|
- id: cpplint
|
|
alias: r
|
|
name: R (C++) Lint
|
|
args:
|
|
- "--verbose=2"
|
|
types_or:
|
|
- c++
|
|
files: >-
|
|
^r/src/
|
|
exclude: >-
|
|
(
|
|
?^r/src/arrowExports\.cpp$|
|
|
)
|
|
- repo: https://github.com/rubocop/rubocop
|
|
rev: "v1.71.0"
|
|
hooks:
|
|
- id: rubocop
|
|
name: Ruby Format
|
|
alias: ruby
|
|
args:
|
|
- "--autocorrect"
|
|
exclude: >-
|
|
(
|
|
?^dev/tasks/homebrew-formulae/.*\.rb$|
|
|
?^ruby/red-arrow-format/lib/arrow-format/org/.*\.rb$|
|
|
)
|
|
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
|
rev: v0.6.13
|
|
hooks:
|
|
- id: cmake-format
|
|
alias: cpp
|
|
name: CMake Format
|
|
files: >-
|
|
(
|
|
?.*CMakeLists\.txt$|
|
|
?^ci/.*/.*\.cmake$|
|
|
?^cpp/.*/.*\.cmake\.in$|
|
|
?^cpp/.*/.*\.cmake$|
|
|
)
|
|
exclude: >-
|
|
(
|
|
?^cpp/cmake_modules/FindNumPy\.cmake$|
|
|
?^cpp/cmake_modules/FindPythonLibsNew\.cmake$|
|
|
?^cpp/cmake_modules/UseCython\.cmake$|
|
|
?^cpp/src/arrow/util/.*\.h\.cmake$|
|
|
)
|
|
- repo: https://github.com/sphinx-contrib/sphinx-lint
|
|
rev: v0.9.1
|
|
hooks:
|
|
- id: sphinx-lint
|
|
alias: docs
|
|
files: ^docs/source
|
|
exclude: ^docs/source/python/generated
|
|
args: [
|
|
'--enable',
|
|
'all',
|
|
'--disable',
|
|
'dangling-hyphen,line-too-long',
|
|
]
|
|
- repo: https://github.com/koalaman/shellcheck-precommit
|
|
rev: v0.11.0
|
|
hooks:
|
|
- id: shellcheck
|
|
alias: shell
|
|
# TODO: Remove this when we fix all lint failures
|
|
files: >-
|
|
(
|
|
?^c_glib/.*\.sh$|
|
|
?^ci/.*\.sh$|
|
|
?^cpp/.*\.sh$|
|
|
?^dev/release/05-binary-upload\.sh$|
|
|
?^dev/release/07-flightsqlodbc-upload\.sh$|
|
|
?^dev/release/08-publish-gh-release\.sh$|
|
|
?^dev/release/09-binary-verify\.sh$|
|
|
?^dev/release/account-ruby\.sh$|
|
|
?^dev/release/binary-recover\.sh$|
|
|
?^dev/release/post-01-tag\.sh$|
|
|
?^dev/release/post-02-upload\.sh$|
|
|
?^dev/release/post-03-binary\.sh$|
|
|
?^dev/release/post-05-update-gh-release-notes\.sh$|
|
|
?^dev/release/post-07-remove-old-artifacts\.sh$|
|
|
?^dev/release/post-08-docs\.sh$|
|
|
?^dev/release/post-09-python\.sh$|
|
|
?^dev/release/post-13-vcpkg\.sh$|
|
|
?^dev/release/post-14-conan\.sh$|
|
|
?^dev/release/setup-rhel-rebuilds\.sh$|
|
|
?^dev/release/utils-generate-checksum\.sh$|
|
|
?^dev/release/utils-watch-gh-workflow\.sh$|
|
|
?^r/.*\.sh$|
|
|
)
|
|
- repo: https://github.com/scop/pre-commit-shfmt
|
|
# v3.11.0-1 or later requires pre-commit 3.2.0 or later but Ubuntu
|
|
# 22.04 ships pre-commit 2.17.0. We can use update this rev after
|
|
# Ubuntu 22.04 reached EOL (June 2027).
|
|
rev: v3.10.0-1
|
|
hooks:
|
|
- id: shfmt
|
|
alias: shell
|
|
args:
|
|
# The default args is "--write --simplify" but we don't use
|
|
# "--simplify". Because it's conflicted will ShellCheck.
|
|
- "--write"
|
|
# TODO: Remove this when we fix all lint failures
|
|
files: >-
|
|
(
|
|
?^ci/scripts/python_test_type_annotations\.sh$|
|
|
?^cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc\.sh$|
|
|
?^dev/release/05-binary-upload\.sh$|
|
|
?^dev/release/07-flightsqlodbc-upload\.sh$|
|
|
?^dev/release/binary-recover\.sh$|
|
|
?^dev/release/post-03-binary\.sh$|
|
|
?^dev/release/post-08-docs\.sh$|
|
|
?^dev/release/post-09-python\.sh$|
|
|
)
|
|
- repo: https://github.com/trim21/pre-commit-mirror-meson
|
|
rev: v1.9.0
|
|
hooks:
|
|
- id: meson-fmt
|
|
alias: cpp
|
|
args: ['--inplace']
|
|
files: >-
|
|
(
|
|
?.*meson\.build$|
|
|
?.*meson\.options$|
|
|
)
|