-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruff.toml
94 lines (84 loc) · 3.02 KB
/
ruff.toml
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
extend-exclude = [
".idea",
".ipynb_checkpoints",
".pyenv",
".pytest_cache",
".vscode",
"site-packages",
"external",
]
line-length = 175
fix = true
show-fixes = true
target-version = "py312"
required-version = ">=0.4.4"
[lint]
select = [
"ALL", # Every check supported by Ruff
]
ignore = [
# pydocstyle (D)
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
# eradicate (ERA)
"ERA001", # Found commented-out code
# Pylint (PL)
"PLR0913", # Too many arguments for function
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
# flake8-annotations (ANN)
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
# flake8-errmsg (EM)
"EM101", # Exception must not use a string literal, assign to variable first
"EM102", # Exception must not use an f-string literal, assign to variable first
# flake8-future-annotations (FA)
"FA", # Missing from __future__ import annotations
# flake8-fixme (FIX)
"FIX001", # Line contains FIXME
"FIX002", # Line contains TODO
# flake8-bandit (S)
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
# flake8-use-pathlib (PTH)
"PTH", # Use pathlib instead of os.path. Dask does not seem to like pathlib.
# flake8-quotes (Q)
"Q000", # Single quotes found but double quotes preferred
# flake8-simplify (SIM)
"SIM108", # Use ternary operator instead of `if`-`else`-block
# flake8-type-checking (TCH)
"TCH001", # Move application import into a type-checking block. Breaks Sphinx autodoc (https://github.com/sphinx-doc/sphinx/issues/11225).
"TCH002", # Move third-party import into a type-checking block. Breaks Sphinx autodoc (https://github.com/sphinx-doc/sphinx/issues/11225).
"TCH003", # Move standard library import into a type-checking block. Breaks Sphinx autodoc (https://github.com/sphinx-doc/sphinx/issues/11225).
# flake8-todos (TD)
"TD003", # Missing issue link on the line following this TODO
# tryceratops (TRY)
"TRY003", # Avoid specifying long messages outside the exception class
]
external = [
"DOC", # pydoclint
]
[lint.per-file-ignores]
"test/**/*.py" = [
# flake8-bandit (S)
"S101", # Asserts allowed in tests
# flake8-pytest-style (PT)
"PT009", # Use a regular assert instead of unittest-style {assertion}
# Pylint (PL), Refactor (R)
"PLR2004", # Magic values in comparison allowed in tests
]
[lint.flake8-annotations]
allow-star-arg-any = true
[lint.flake8-unused-arguments]
ignore-variadic-names = true
[lint.flake8-import-conventions.extend-aliases]
"dask.array" = "da"
"dask.dataframe" = "dd"
"numpy.typing" = "npt"
"lightning" = "L"
[lint.isort]
known-third-party = ["wandb"]
[lint.pep8-naming]
extend-ignore-names = ["X*"]
[lint.pydocstyle]
convention = "pep257"
[format]
docstring-code-format = true