-
-
Notifications
You must be signed in to change notification settings - Fork 288
/
pyproject.toml
86 lines (74 loc) · 2.44 KB
/
pyproject.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
[project]
# Support Python 3.8+.
requires-python = ">=3.8"
[tool.ruff]
# Same as Black.
line-length = 88
indent-width = 4
src = ["backend/src"]
# ignore vendored code
extend-exclude = ["**/pytorch/architecture/**"]
unsafe-fixes = true
[tool.ruff.lint]
# Add the `line-too-long` rule to the enforced rule set.
extend-select = [
"UP", # pyupgrade
"E", # pycodestyle
"W", # pycodestyle
"F", # pyflakes
"I", # isort
"N", # pep8-naming
# "ANN", # flake8-annotations
"ANN001",
"ANN002",
# "ASYNC", # flake8-async
"PL", # pylint
"RUF", # ruff
"B", # flake8-bugbear
# "A", # flake8-builtins
# "COM", # flake8-commas
"C4", # flake8-comprehensions
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
# "INP", # flake8-implicit-namespaces
"PIE", # flake8-pie
# "PYI", # flake8-pyi
"Q", # flake8-quotes
# "RET", # flake8-return
"SLF", # flake8-self
# "SIM", # flake8-simplify
# "TCH", # flake8-tidy-imports
"NPY", # NumPy-specific rules
]
ignore = [
"E501", # Line too long
"PLR2004", # Magic value
"PLR0911", # Too many return statements
"PLR0912", # Too many branches
"PLR0913", # Too many arguments
"PLR0915", # Too many statements,
"E741", # Ambiguous variable name,
"E712", # true-false-comparison, has false positives because of numpy's operator overloading
"F821", # Undefined name -- this one is weird, it seems like it has false positives on closures and other context changes
"F403", # 'from module import *' used; unable to detect undefined names
"PLW0603", # Using the global statement
"N999", # Invalid module name (which triggers for chaiNNer)
"N818", # Exception name should end in Error
"ISC001", # Implicit string concatenation, conflicts with formatter
]
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.pep8-naming]
ignore-names = ["*Input", "*Output", "*Dropdown"]
[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning", "ignore::UserWarning"]
pythonpath = ["backend/src"]