File: .pre-commit-config.yaml

package info (click to toggle)
apache-arrow 23.0.1-1
  • links: PTS
  • area: main
  • in suites: sid
  • size: 76,220 kB
  • sloc: cpp: 654,608; python: 70,522; ruby: 45,964; ansic: 18,742; sh: 7,365; makefile: 669; javascript: 125; xml: 41
file content (398 lines) | stat: -rw-r--r-- 12,170 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
# 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: v14.0.6
    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: v14.0.6
    hooks:
      - id: clang-format
        alias: c-glib
        name: C/GLib Format
        files: >-
          ^c_glib/
  - repo: https://github.com/pre-commit/mirrors-clang-format
    rev: v14.0.6
    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.16.2
    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: v14.0.6
    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: local
    hooks:
      - id: lintr
        alias: r
        name: R Lint
        language: r
        additional_dependencies:
          - cyclocomp
          - lintr
          - testthat
        entry: |
          Rscript -e "Sys.setenv(NOT_CRAN = 'TRUE'); lintr::expect_lint_free('r')"
        pass_filenames: false
        files: >-
          ^r/.*\.(R|Rmd)$
  - repo: local
    hooks:
      - id: air-format
        alias: r
        name: R Format (Air)
        language: system
        entry: air format r --check
        files: >-
            ^r/.*\.R$
  - repo: https://github.com/pre-commit/mirrors-clang-format
    rev: v14.0.6
    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: >-
          (
          ?^ci/conan/all/.*CMakeLists\.txt$|
          ?^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.10.0
    hooks:
      - id: shellcheck
        alias: shell
        # TODO: Remove this when we fix all lint failures
        files: >-
          (
          ?^c_glib/test/run-test\.sh$|
          ?^ci/scripts/c_glib_build\.sh$|
          ?^ci/scripts/c_glib_test\.sh$|
          ?^ci/scripts/ccache_setup\.sh$|
          ?^ci/scripts/conan_build\.sh$|
          ?^ci/scripts/conan_setup\.sh$|
          ?^ci/scripts/cpp_test\.sh$|
          ?^ci/scripts/download_tz_database\.sh$|
          ?^ci/scripts/install_azurite\.sh$|
          ?^ci/scripts/install_ccache\.sh$|
          ?^ci/scripts/install_ceph\.sh$|
          ?^ci/scripts/install_chromedriver\.sh$|
          ?^ci/scripts/install_cmake\.sh$|
          ?^ci/scripts/install_conda\.sh$|
          ?^ci/scripts/install_dask\.sh$|
          ?^ci/scripts/install_emscripten\.sh$|
          ?^ci/scripts/install_gcs_testbench\.sh$|
          ?^ci/scripts/install_iwyu\.sh$|
          ?^ci/scripts/install_minio\.sh$|
          ?^ci/scripts/install_ninja\.sh$|
          ?^ci/scripts/install_numba\.sh$|
          ?^ci/scripts/install_numpy\.sh$|
          ?^ci/scripts/install_pandas\.sh$|
          ?^ci/scripts/install_python\.sh$|
          ?^ci/scripts/install_sccache\.sh$|
          ?^ci/scripts/install_spark\.sh$|
          ?^ci/scripts/install_vcpkg\.sh$|
          ?^ci/scripts/integration_arrow_build\.sh$|
          ?^ci/scripts/integration_arrow\.sh$|
          ?^ci/scripts/integration_dask\.sh$|
          ?^ci/scripts/integration_hdfs\.sh$|
          ?^ci/scripts/integration_spark\.sh$|
          ?^ci/scripts/matlab_build\.sh$|
          ?^ci/scripts/msys2_setup\.sh$|
          ?^ci/scripts/msys2_system_clean\.sh$|
          ?^ci/scripts/msys2_system_upgrade\.sh$|
          ?^ci/scripts/nanoarrow_build\.sh$|
          ?^ci/scripts/python_build_emscripten\.sh$|
          ?^ci/scripts/python_build\.sh$|
          ?^ci/scripts/python_sdist_build\.sh$|
          ?^ci/scripts/python_sdist_test\.sh$|
          ?^ci/scripts/python_wheel_unix_test\.sh$|
          ?^ci/scripts/r_build\.sh$|
          ?^ci/scripts/r_revdepcheck\.sh$|
          ?^ci/scripts/release_test\.sh$|
          ?^ci/scripts/ruby_test\.sh$|
          ?^ci/scripts/rust_build\.sh$|
          ?^ci/scripts/util_download_apache\.sh$|
          ?^ci/scripts/util_enable_core_dumps\.sh$|
          ?^ci/scripts/util_free_space\.sh$|
          ?^ci/scripts/util_log\.sh$|
          ?^cpp/build-support/build-lz4-lib\.sh$|
          ?^cpp/build-support/build-zstd-lib\.sh$|
          ?^cpp/build-support/get-upstream-commit\.sh$|
          ?^cpp/build-support/update-thrift\.sh$|
          ?^cpp/examples/minimal_build/run\.sh$|
          ?^cpp/examples/tutorial_examples/run\.sh$|
          ?^dev/release/05-binary-upload\.sh$|
          ?^dev/release/08-binary-verify\.sh$|
          ?^dev/release/binary-recover\.sh$|
          ?^dev/release/post-03-binary\.sh$|
          ?^dev/release/post-08-docs\.sh$|
          ?^dev/release/post-09-python\.sh$|
          ?^dev/release/setup-rhel-rebuilds\.sh$|
          ?^dev/release/utils-generate-checksum\.sh$|
          ?^python/asv-install\.sh$|
          ?^python/asv-uninstall\.sh$|
          ?^swift/gen-protobuffers\.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: >-
          (
          ?^dev/release/05-binary-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$|
          )