Skip to content

Commit f2f73c8

Browse files
committed
varios ruff issues
1 parent 4a93405 commit f2f73c8

25 files changed

+243
-82
lines changed

pyproject.toml

Lines changed: 46 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -105,85 +105,55 @@ exclude = [
105105
]
106106

107107

108-
[tool.ruff.per-file-ignores]
109-
"__init__.py" = ["D104", "F401", "F403"]
110-
"**/builders/*" = ["D"]
111-
"tests/**" = ["D101"]
112-
"server.py" = ["D100", "D103"]
113-
114-
115108
[tool.ruff.lint]
116109
select = [
117-
# pycodestyle
118-
"E", "W293",
119-
# Pyflakes
120-
"F",
121-
# pep8-naming
122-
"N",
123-
# pydocstyle
124-
"D",
125-
# pyupgrade
126-
"UP",
127-
# flake8-bandit
128-
"S",
129-
# flake8-bugbear
130-
"B",
131-
# flake8-commas
132-
"COM",
133-
# flake8-comprehensions
134-
"C4",
135-
# flake8-future-annotations
136-
"FA",
137-
# flake8-implicit-str-concat
138-
"ISC",
139-
# flake8-logging-format
140-
"G",
141-
# flake8-pie
142-
"PIE",
143-
# flake8-quotes
144-
"Q",
145-
# flake8-return
146-
"RET",
147-
# flake8-simplify
148-
"SIM",
149-
# flake8-unused-arguments
150-
"ARG",
151-
# Perflint
152-
"PERF",
153-
# Ruff-specific rules
154-
"RUF",
155-
# flake8-annotations
156-
"ANN",
157-
110+
"E", "W293", # pycodestyle
111+
"F", # Pyflakes
112+
"N", # pep8-naming
113+
"D", # pydocstyle
114+
"UP", # pyupgrade
115+
"S", # flake8-bandit
116+
"B", # flake8-bugbear
117+
"COM", # flake8-commas
118+
"C4", # flake8-comprehensions
119+
"FA", # flake8-future-annotations
120+
"ISC", # flake8-implicit-str-concat
121+
"G", # flake8-logging-format
122+
"PIE", # flake8-pie
123+
"Q", # flake8-quotes
124+
"RET", # flake8-return
125+
"SIM", # flake8-simplify
126+
"ARG", # flake8-unused-arguments
127+
"PERF", # Perflint
128+
"RUF", # Ruff-specific rules
129+
"ANN", # flake8-annotations
130+
"DTZ", # flake8-datetimez
131+
"PL", # Pylint
132+
"FURB", # refurb
158133
]
159134
ignore = [
160-
# Missing docstring in magic method
161-
"D105",
162-
# Missing docstring in `__init__`
163-
"D107",
164-
# Unused lambda argument
165-
"ARG005",
166-
# 1 blank line required before class docstring
167-
"D203",
168-
# 1 blank line required before class docstring
169-
"D213",
170-
# Mutable class attributes should be annotated with `typing.ClassVar`
171-
"RUF012",
172-
# PEP 484 prohibits implicit `Optional`
173-
"RUF013",
174-
175-
# Missing type annotation for {name} in method
176-
"ANN101",
177-
# Missing type annotation for {name} in classmethod
178-
"ANN102",
179-
# Missing return type annotation for private function {name}
180-
"ANN202",
181-
# Missing return type annotation for special method {name}
182-
"ANN204",
183-
# Dynamically typed expressions ({name}) are disallowed in `other`
184-
"ANN401",
135+
"D105", # Missing docstring in magic method
136+
"D107", # Missing docstring in `__init__`
137+
"ARG005", # Unused lambda argument
138+
"D203", # 1 blank line required before class docstring
139+
"D213", # 1 blank line required before class docstring
140+
"RUF012", # Mutable class attributes should be annotated with `typing.ClassVar`
141+
"RUF013", # PEP 484 prohibits implicit `Optional`
142+
"ANN101", # Missing type annotation for {name} in method
143+
"ANN102", # Missing type annotation for {name} in classmethod
144+
"ANN202", # Missing return type annotation for private function {name}
145+
"ANN204", # Missing return type annotation for special method {name}
146+
"ANN401", # Dynamically typed expressions ({name}) are disallowed in `other`
147+
"PLR0913", # Too many arguments in function definition
148+
"PLR2004", # Magic value used in comparison, consider replacing `{number}` with a constant variable
185149
]
186150

151+
[tool.ruff.lint.per-file-ignores]
152+
"__init__.py" = ["D104", "F401", "F403"]
153+
"**/builders/*" = ["D"]
154+
"tests/**" = ["D101"]
155+
"server.py" = ["D100", "D103"]
156+
187157

188158
[tool.ruff.lint.pycodestyle]
189159
max-line-length = 120
@@ -198,3 +168,6 @@ keep-runtime-typing = true
198168
[tool.ruff.lint.flake8-bugbear]
199169
# Allow default arguments like, e.g., `data: List[str] = fastapi.Query(None)`.
200170
extend-immutable-calls = ["fastapi.Depends", "fastapi.Query", "fastapi.Path"]
171+
172+
[tool.ruff.lint.flake8-type-checking]
173+
runtime-evaluated-base-classes = ["pydantic.BaseModel"]

0 commit comments

Comments
 (0)