-
Notifications
You must be signed in to change notification settings - Fork 228
Expand file tree
/
Copy pathpyproject.toml
More file actions
80 lines (73 loc) · 2.72 KB
/
pyproject.toml
File metadata and controls
80 lines (73 loc) · 2.72 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
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
[tool.ruff]
line-length = 79
include = [
"*.py",
"*.pyx",
"*.pxd",
"*.pxi",
]
exclude = [
"thirdparty",
"__init__.py",
]
[tool.ruff.lint]
ignore = [
# whitespace before :
"E203",
]
[tool.ruff.lint.per-file-ignores]
# Rules ignored only in Cython:
# E211: whitespace before '(' (used in multi-line imports)
# E225: Missing whitespace around operators (breaks cython casting syntax like <int>)
# E226: Missing whitespace around arithmetic operators (breaks cython pointer syntax like int*)
# E227: Missing whitespace around bitwise or shift operator (Can also break casting syntax)
# E275: Missing whitespace after keyword (Doesn't work with Cython except?)
# E402: invalid syntax (works for Python, not Cython)
# E999: invalid syntax (works for Python, not Cython)
"*.pyx" = ["E211", "E225", "E226", "E227", "E275", "E402", "E999"]
"*.pxd" = ["E211", "E225", "E226", "E227", "E275", "E402", "E999"]
"*.pxi" = ["E211", "E225", "E226", "E227", "E275", "E402", "E999"]
"*.ipynb" = ["F401"]
[tool.ruff.lint.isort]
combine-as-imports = true
order-by-type = true
default-section = "third-party"
section-order = [
"future",
"standard-library",
"third-party",
"dask",
"rapids",
"first-party",
"local-folder",
]
[tool.pydocstyle]
# Due to https://github.com/PyCQA/pydocstyle/issues/363, we must exclude rather
# than include using match-dir. Note that as discussed in
# https://stackoverflow.com/questions/65478393/how-to-filter-directories-using-the-match-dir-flag-for-pydocstyle,
# unlike the match option above this match-dir will have no effect when
# pydocstyle is invoked from pre-commit. Therefore this exclusion list must
# also be maintained in the pre-commit config file.
match-dir = "^(?!(ci|cpp|conda|docs)).*$"
select = "D201, D204, D206, D207, D208, D209, D210, D211, D214, D215, D300, D301, D302, D403, D405, D406, D407, D408, D409, D410, D411, D412, D414, D418"
# Would like to enable the following rules in the future:
# D200, D202, D205, D400
[tool.mypy]
ignore_missing_imports = true
# If we don't specify this, then mypy will check excluded files if
# they are imported by a checked file.
follow_imports = "skip"
exclude = [
"pylibraft/pylibraft/tests",
]
[tool.codespell]
# note: pre-commit passes explicit lists of files here, which this skip file list doesn't override -
# this is only to allow you to run codespell interactively
skip = "./.git,./.github,./cpp/build,.*egg-info.*,./.mypy_cache,.*_skbuild"
# ignore short words, and typename parameters like OffsetT
ignore-regex = "\\b(.{1,4}|[A-Z]\\w*T)\\b"
ignore-words-list = "inout,unparseable,numer"
builtin = "clear"
quiet-level = 3