-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
57 lines (50 loc) · 2.05 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
## ruff
# Recommended ruff config for now, to be updated as we go along.
[tool.ruff]
target-version = 'py39'
# See all rules at https://docs.astral.sh/ruff/rules/
lint.select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # Pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"I", # isort
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"PT", # flake8-pytest-style
"RUF", # Ruff-specific rules
"FBT001", # flake8-boolean-trap
]
lint.ignore = [
"E501", # "Line too long"
# -> line length already regulated by the formatter
"PT011", # "pytest.raises() should specify expected exception"
# -> would imply to update tests every time you update exception message
"SIM102", # "Use a single `if` statement instead of nested `if` statements"
# -> too restrictive
"TCH002", # "Move import into a type-checking block"
# -> Add complexity in code"
"B904", # B904 Within an `except` clause, raise exceptions with `raise ... from err` to distinguish them from errors in exception handling
# -> TODO: readd this rule later on
"B008", # Do not perform function call `Depends` in argument defaults
# -> TODO: readd this rule later on once the proposed fix is sure to work
]
[tool.ruff.lint.pydocstyle]
# Automatically disable rules that are incompatible with Google docstring convention
convention = "google"
[tool.ruff.lint.pycodestyle]
max-doc-length = 150
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.flake8-type-checking]
strict = true
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
# Pydantic needs to be able to evaluate types at runtime
# see https://pypi.org/project/flake8-type-checking/ for flake8-type-checking documentation
# see https://beta.ruff.rs/docs/settings/#flake8-type-checking-runtime-evaluated-base-classes for ruff documentation
[tool.ruff.lint.per-file-ignores]
# Allow missing docstrings for tests
"tests/**/*.py" = ["D1"]