-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.ruff.toml
More file actions
89 lines (77 loc) · 2.14 KB
/
.ruff.toml
File metadata and controls
89 lines (77 loc) · 2.14 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
# Same as Black
line-length = 88
# Assume Python 3.12
target-version = "py312"
[lint]
# Enable a comprehensive set of rules
select = [
"E", # pycodestyle errors
"F", # pyflakes
"I", # isort
"W", # pycodestyle warnings
"C90", # mccabe complexity
"N", # pep8-naming
"B", # flake8-bugbear
"UP", # pyupgrade
"S", # flake8-bandit (security)
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"ARG", # flake8-unused-arguments
]
# Exclude a variety of commonly ignored directories
exclude = [
".git",
".github",
".pytest_cache",
".ruff_cache",
".venv",
"__pypackages__",
"_build",
"build",
"dist",
"node_modules",
"venv",
"test_data",
"coverage",
"reports",
]
# Allow unused variables when underscore-prefixed
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Ignore some rules
ignore = [
"E501", # line too long, handled by formatter
"B008", # do not perform function calls in argument defaults
"COM812", # missing trailing comma, conflicts with formatter
]
# Ignore `E402` (import violations) in all `__init__.py` files
[lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
"tests/**/*.py" = ["S101"] # Allow assert in tests
"app/**/test_*.py" = ["S101"] # Allow assert in app test files
# Enable auto-fixing
fixable = ["ALL"]
unfixable = []
[lint.isort]
known-third-party = ["fastapi", "pydantic", "motor", "pytest"]
[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"