-
Notifications
You must be signed in to change notification settings - Fork 0
/
.ruff.toml
100 lines (89 loc) · 2.43 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
95
96
97
98
99
100
line-length = 120
indent-width = 4
# Assume Python 3.9.
target-version = "py39"
# A list of file patterns to include when linting.
include = ["**/pyproject.toml", "*.py", "*.pyi"]
extend-include = ["*.ipynb"]
# Rules: https://beta.ruff.rs/docs/rules/
# Enable Pyflakes `E` and `F` codes by default.
select = [
#default
"E", # pycodestyle error
"F", #flake8 error
#extra
"A", # bultin shadowing
"B", # flake8 bugbear
"BLE", # aboid bare excepts
"C4", # simplify comprehensions
"D", # docstyle
"DTZ", # datetime errors
"FBT", # avoid boolean trap
"G", # logging format
"I", # flake8-isort import
"N", # pep8 naming
"RET", # return statements values
"S", # bandit
"YTT", # wrong usage of sys.info
"B", # flake8-bugbear
]
ignore = [
"B008", # do not perform function calls in argument defaults
"BLE001", #Do not catch blind exception: {name}
"C901", # too complex
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D417", # Missing argument description in the docstring for {definition}: {name}
"E501", # Line too long ({width} > {limit} characters)
"E501", # line too long, handled by black
"D100",
]
# Always autofix, but never try to fix `F401` (unused imports).
fix = true
fixable = ["ALL"]
unfixable = ["F401"]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = ">=(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Exclude a variety of commonly ignored directories (you can have some problems)
exclude = [
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
".venv"
]
[format]
# select = ["E4", "E7", "E9", "F"]
# exclude = ["*.ipynb"]
# ignore = []
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[flake8-quotes]
docstring-quotes = "double"
[pydocstyle]
convention = "google"
[isort]
known-third-party = ["fastapi", "pydantic", "starlette"]
[per-file-ignores]
"__init__.py" = ["D104", "F401", "I002"]
"test*.py" = ["S101", "T201"]