-
-
Notifications
You must be signed in to change notification settings - Fork 345
Expand file tree
/
Copy pathpyproject.toml
More file actions
127 lines (111 loc) · 3.53 KB
/
pyproject.toml
File metadata and controls
127 lines (111 loc) · 3.53 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
[project]
# Support Python 3.10+.
requires-python = ">=3.10"
[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
# "ERA", # Eradicate commented code
"YTT", # flake8-2020,
# "S", # flake8-bandit
]
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
"PLC0415", # Conditional import used --- conflicts with optional dependencies
"S101", # Use of assert detected. The enclosed code will be removed when compiling to optimised bytecode.
]
[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.ruff.lint.per-file-ignores]
"backend/tests/*.py" = ["ANN001", "ANN002"]
"backend/src/process.py" = ["SLF001"]
[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning", "ignore::UserWarning"]
pythonpath = ["backend/src"]
[tool.coverage.run]
source = ["backend/src"]
omit = [
"backend/src/packages/**",
"backend/src/nodes/**",
"backend/src/server.py",
"backend/src/server_host.py",
"backend/src/server_process_helper.py",
"backend/src/run.py",
"backend/src/dependencies/**",
"backend/src/texconv/**",
"backend/src/fonts/**",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
precision = 2
show_missing = true
skip_covered = false
[tool.coverage.html]
directory = "htmlcov"