-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
298 lines (295 loc) · 10.5 KB
/
.pre-commit-config.yaml
File metadata and controls
298 lines (295 loc) · 10.5 KB
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
# SPDX-FileCopyrightText: Copyright (c) 2019-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
ci:
autofix_commit_msg: "[pre-commit.ci] auto code formatting"
autofix_prs: false
autoupdate_branch: ""
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
autoupdate_schedule: quarterly
skip: ["mypy", "verify-alpha-spec"]
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)^(
^cpp/cmake/thirdparty/patches/.*|
^python/cudf/cudf/tests/data/vocab.txt
)
- id: end-of-file-fixer
exclude: |
(?x)^(
^cpp/cmake/thirdparty/patches/.*|
^python/cudf/cudf/tests/data/vocab.txt
)
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.18.1
hooks:
- id: cython-lint
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.13.0'
hooks:
- id: mypy
additional_dependencies: [
polars,
"numpy",
pyarrow-stubs,
"pyarrow<24.0.0", # https://github.com/rapidsai/cudf/issues/22229
pytest,
types-cachetools,
"rmm-cu12==26.6.*,>=0.0.0a0; sys_platform=='linux'",
"--extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple/"
]
args: ["--config-file=pyproject.toml",
"python/cudf/cudf",
"python/pylibcudf/pylibcudf",
"python/custreamz/custreamz",
"python/cudf_kafka/cudf_kafka",
"python/cudf_polars/cudf_polars",
"python/cudf_polars/tests",
"python/dask_cudf/dask_cudf"]
pass_filenames: false
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v20.1.8
hooks:
- id: clang-format
types_or: [c, c++, cuda]
args: ["-fallback-style=none", "-style=file", "-i"]
exclude: |
(?x)^(
^cpp/src/io/parquet/ipc/Schema_generated.h|
^cpp/src/io/parquet/ipc/Message_generated.h|
^cpp/include/cudf_test/cxxopts.hpp
)
- repo: https://github.com/sirosen/texthooks
rev: 0.7.1
hooks:
- id: fix-smartquotes
exclude: |
(?x)^(
^cpp/src/io/parquet/ipc/Schema_generated.h|
^cpp/src/io/parquet/ipc/Message_generated.h|
^cpp/include/cudf_test/cxxopts.hpp|
^python/cudf/cudf/tests/data/text/vocab.txt|
^python/cudf/cudf/tests/text/test_text_methods.py
)
- repo: local
hooks:
- id: no-deprecationwarning
name: no-deprecationwarning
description: 'Enforce that DeprecationWarning is not introduced (use FutureWarning instead)'
entry: '(category=|\s)DeprecationWarning[,)]'
language: pygrep
types_or: [python, cython]
# We need to exclude just the following file because few APIs still need
# DeprecationWarning: https://github.com/pandas-dev/pandas/issues/54970
exclude: |
(?x)^(
^python/cudf/cudf/core/dtypes.py|
^python/cudf/cudf/tests/pytest.ini|
^python/cudf/cudf/tests/series/test_binops.py
)
- id: no-programmatic-xfail
name: no-programmatic-xfail
description: 'Enforce that pytest.xfail is not introduced (see dev docs for details)'
entry: 'pytest\.xfail'
language: pygrep
types: [python]
- id: use-exec-policy-nosync
name: use-exec-policy-nosync
description: 'Enforce that rmm::exec_policy_nosync is used instead of rmm::exec_policy (see developer guide)'
entry: 'rmm::exec_policy\('
language: pygrep
types_or: [c, c++, cuda]
- id: use-cudf-memcpy-async
name: use-cudf-memcpy-async
description: 'Enforce that cudf::detail::memcpy_async or memcpy_batch_async is used instead of cudaMemcpyAsync (see developer guide)'
entry: 'cudaMemcpyAsync'
language: pygrep
types_or: [c, c++, cuda]
files: '^cpp/(src|include)/'
exclude: |
(?x)^(
cpp/src/utilities/host_memory\.cpp|
cpp/src/utilities/cuda_memcpy\.cu|
cpp/src/io/utilities/data_sink\.cpp|
cpp/include/cudf/contiguous_split\.hpp|
cpp/include/cudf/utilities/pinned_memory\.hpp|
cpp/include/cudf/utilities/error\.hpp
)$
- id: no-unseeded-default-rng
name: no-unseeded-default-rng
description: 'Enforce that no non-seeded default_rng is used and default_rng is used instead of np.random.seed'
entry: |
# Check for usage of default_rng without seeding
default_rng\(\)|
# Check for usage of np.random.seed (NPY002 only disallows this being called)
np.random.seed
language: pygrep
types: [python]
- id: cudf-polars-ir-signatures
name: cudf-polars-ir-signatures
description: 'Validate cudf-polars IR.do_evaluate signatures.'
entry: ./ci/check_cudf_polars_ir.py
language: python
files: ^python/cudf_polars/cudf_polars/(dsl/ir|experimental/(shuffle|io|sort))\.py$
pass_filenames: true
verbose: true
types: [python]
- id: cmake-format
name: cmake-format
entry: ./cpp/scripts/run-cmake-format.sh cmake-format
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
verbose: true
require_serial: true
- id: cmake-lint
name: cmake-lint
entry: ./cpp/scripts/run-cmake-format.sh cmake-lint
language: python
types: [cmake]
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
verbose: true
require_serial: true
- id: doxygen-check
name: doxygen-check
entry: ./ci/checks/doxygen.sh
files: ^cpp/include/
types_or: [file]
language: system
pass_filenames: false
verbose: true
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
additional_dependencies: [tomli]
args: ["--toml", "pyproject.toml"]
exclude: |
(?x)^(
.*test.*|
^CHANGELOG.md$
)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.3
hooks:
- id: ruff
args: ["--fix"]
- id: ruff-format
- repo: https://github.com/rapidsai/pre-commit-hooks
rev: v1.4.1
hooks:
- id: verify-copyright
name: verify-copyright-cudf
args: [--fix, --spdx]
files: |
(?x)
[.](cmake|cpp|cu|cuh|h|hpp|sh|pxd|py|pyx|pyi|rs|java|bat)$|
CMakeLists[.]txt$|
CMakeLists_standalone[.]txt$|
meta[.]yaml$|
pyproject[.]toml$|
setup[.]cfg$|
^cpp/src/text/detail/codepoint_metadata[.]ah$|
^cpp/src/strings/regex/regex[.]inl$|
^cpp/src/io/parquet/ipc/schema/.*[.]fbs$|
^java/pom[.]xml$|
^java/buildscripts/build-info$|
^java/ci/Dockerfile[.]rocky$|
recipe[.]yaml$|
dependencies[.]yaml$|
pytest[.]ini$|
^[.]pre-commit-config[.]yaml$|
Makefile$
exclude: |
(?x)^(
cpp/include/cudf_test/cxxopts[.]hpp$|
cpp/src/io/parquet/ipc/Message_generated[.]h$|
cpp/src/io/parquet/ipc/Schema_generated[.]h$|
cpp/src/io/comp/brotli_dict[.]cpp$|
cpp/src/io/comp/brotli_dict[.]hpp$|
cpp/src/io/comp/brotli_tables[.]hpp$|
cpp/src/io/comp/debrotli[.]cu$|
cpp/src/io/comp/cpu_unbz2[.]cpp$|
cpp/src/io/comp/unbz2[.]hpp$|
cpp/src/io/comp/gpuinflate[.]cu$|
cpp/src/io/utilities/base64_utilities[.]cpp$|
cpp/src/io/utilities/base64_utilities[.]hpp$
)
- id: verify-copyright
name: verify-copyright-brotli
args: [--fix, --spdx, "--spdx-license-identifier=Apache-2.0 AND MIT"]
files: |
(?x)^(
cpp/src/io/comp/brotli_dict[.]cpp$|
cpp/src/io/comp/brotli_dict[.]hpp$|
cpp/src/io/comp/brotli_tables[.]hpp$|
cpp/src/io/comp/debrotli[.]cu$
)
- id: verify-copyright
name: verify-copyright-bzip2
args: [--fix, --spdx, "--spdx-license-identifier=Apache-2.0 AND bzip2-1.0.6"]
files: |
(?x)^(
cpp/src/io/comp/cpu_unbz2[.]cpp$|
cpp/src/io/comp/unbz2[.]hpp$
)
- id: verify-copyright
name: verify-copyright-zlib
args: [--fix, --spdx, "--spdx-license-identifier=Apache-2.0 AND Zlib"]
files: |
(?x)^(
cpp/src/io/comp/gpuinflate[.]cu$|
cpp/src/io/utilities/base64_utilities[.]cpp$|
cpp/src/io/utilities/base64_utilities[.]hpp$
)
- id: verify-copyright
name: verify-copyright-cxxopts
args: [--fix, --spdx, "--spdx-license-identifier=MIT"]
files: |
(?x)^(
cpp/include/cudf_test/cxxopts[.]hpp$
)
- id: verify-alpha-spec
- id: verify-codeowners
args: [--fix, --project-prefix=cudf]
- id: verify-hardcoded-version
exclude: |
(?x)
(^|/)devcontainer[.]json$|
(^|/)dependencies[.]yaml$|
^[.]github/(workflows|ISSUE_TEMPLATE)/|
(^|/)pom[.]xml$|
^[.]pre-commit-config[.]yaml$|
^conda/environments/|
RAPIDS_BRANCH$|
[.](md|rst|avro|parquet|png|orc|gz|pkl|sas7bdat)$|
^python/cudf/cudf/tests|
^python/cudf/cudf/VERSION$
- id: verify-pyproject-license
# ignore the top-level pyproject.toml, which doesn't
# have or need a [project] table
exclude: |
(?x)
^pyproject[.]toml$
- repo: https://github.com/rapidsai/dependency-file-generator
rev: v1.20.2
hooks:
- id: rapids-dependency-file-generator
args: ["--clean", "--warn-all", "--strict"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.11.0.1
hooks:
- id: shellcheck
args: ["--severity=warning"]
default_language_version:
python: python3