-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathruff.toml
More file actions
128 lines (118 loc) · 4.41 KB
/
Copy pathruff.toml
File metadata and controls
128 lines (118 loc) · 4.41 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
128
# ruff.toml: Ruff linter + formatter configuration
# Reference: https://docs.astral.sh/ruff/configuration/
line-length = 100
target-version = "py314"
preview = true
[format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
[lint]
# Rules to run
# Reference: https://docs.astral.sh/ruff/rules/
select = [
"A", # flake8-builtins
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"C90", # mccabe (complexity)
"COM", # flake8-commas
"D", # pydocstyle
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"EM", # flake8-errmsg
"ERA", # eradicate
"EXE", # flake8-executable
"F", # pyflakes
"FA", # flake8-future-annotations
"FAST", # FastAPI-specific rules
"FBT", # flake8-boolean-trap
"FLY", # flynt
"FURB", # Refurb
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"N", # pep8-naming
"NPY", # NumPy-specific rules
"PERF", # Perflint
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PLC", # pylint-convention
"PLE", # pylint-error
"PLR", # pylint-refactor
"PLW", # pylint-warning
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"SLF", # flake8-self
"SLOT", # flake8-slots
"T10", # flake8-debugger
"T20", # flake8-print
"TD", # flake8-todos
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
]
# Rules to ignore
ignore = [
"A003", # builtin-attribute-shadowing. Shadowing `id` in a model for instance.
"ANN401", # No dynamically typed expressions (like "Any")
"COM812", # Missing trailing comma (can cause ruff formatter conflicts)
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring (conflicts with D211 - No blank lines allowed before class docstring)
"D213", # Multi-line docstring summary should start at the second line (conflicts with D212 - Multi-line docstring summary should start at the first line)
"ISC001", # Implicit string concatenation found (can cause ruff formatter conflicts)
"PLC1901", # Compare-to-empty-string (explicit == "" is clearer in tests)
"PLR6301", # Method could be function/classmethod/staticmethod (false pos. on overrides)
"RUF029", # Unused-async (FastAPI exception handlers must be async; same for async fixtures)
"RUF067", # __init__ module should only contain docstrings (project uses __init__ for exports)
"TD002", # missing-todo-author (not required)
"TD003", # missing-todo-link (not required)
]
task-tags = ["TODO", "FIXME"]
# Don't automatically fix these errors, but still report them
unfixable = [
"ERA001", # eradicate commented out code
"T20", # flake8-print
"RUF100", # unused-noqa
]
[lint.per-file-ignores]
"**/__init__.py" = ["D104"] # Missing docstring in public package
"scripts/*" = [
"FBT003", # boolean-positional-value-in-call (needed for typer default arg)
"S101", # use of assert
"S311", # random-not-for-cryptography
"S404", # subprocess-module-is-possibly-insecure (needed for docker commands)
"T201", # 'print' found
]
"scripts/alembic.py" = ["S603"] # subprocess-without-shell-equals-true
"migrations/versions/*" = ["D103"] # Missing docstring in public function
"tests/*" = [
"ANN002", # Missing type annotation for *args
"ANN003", # Missing type annotation for **kwargs
"ANN201", # Missing return type annotation for function
"E501", # line-too-long
"PLR2004", # Magic value comparison
"S101", # assert-used
"S105", # Passwords should not be hard-coded
"S405", # xml.etree-methods (only used for HTML parsing in tests, not external input)
]
[lint.mccabe]
max-complexity = 8
[lint.isort]
known-first-party = ["app", "tests", "scripts"]