Skip to content

Commit 1af9697

Browse files
committed
chore: update Ruff linter configuration
1 parent b4cd0b2 commit 1af9697

File tree

1 file changed

+94
-64
lines changed

1 file changed

+94
-64
lines changed

template/pyproject.toml.jinja

Lines changed: 94 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -129,85 +129,115 @@ ignore_missing_imports = true
129129
line-length = 100
130130

131131
[tool.ruff.lint]
132-
select = [
133-
"F", # Pyflakes
134-
"E", # Pycodestyle (Error)
135-
'I', # isort
136-
'D', # pydocstyle
137-
'UP', # pyupgrade
138-
'YTT', # flake8-2020
139-
'B', # flake8-bugbear
140-
"PLE", # pylint
141-
'PYI006',
142-
'PYI019',
143-
'PYI024',
144-
'PYI030',
145-
'PYI062',
146-
'PYI063',
147-
'PYI066',
148-
"RUF001",
149-
"RUF002",
150-
"RUF003",
151-
"RUF005",
152-
"RUF006",
153-
"RUF012",
154-
"RUF013",
155-
"RUF016",
156-
"RUF017",
157-
"RUF018",
158-
"RUF019",
159-
"RUF020",
160-
"RUF021",
161-
"RUF024",
162-
"RUF026",
163-
"RUF030",
164-
"RUF032",
165-
"RUF033",
166-
"RUF034",
167-
"TRY002",
168-
"TRY004",
169-
"TRY201",
170-
"TRY300",
171-
"TRY301",
172-
"TRY400",
173-
"PERF101",
174-
"RET503",
175-
"LOG001",
176-
"LOG002",
177-
]
132+
select = ["ALL"]
178133
ignore = [
134+
"ERA",
135+
"FBT002",
136+
"COM",
137+
"CPY",
138+
"DJ",
139+
"ANN003",
140+
"FIX",
179141
"D100",
180142
"D101",
181143
"D102",
182144
"D103",
183145
"D104",
184-
'D105',
185-
'D106',
186-
'D107',
187-
'D205',
146+
"D105",
147+
"D106",
148+
"D107",
149+
"D205",
150+
"D203",
188151
"D212",
189-
'D415',
190-
'E501',
191-
'B011',
192-
'B028',
193-
'B904',
194-
'PIE804',
195-
"N802",
196-
"N803",
152+
"E501",
153+
"PIE804",
154+
"S101",
155+
"EM101",
156+
"PYI041",
157+
"PYI051",
158+
"PYI046",
159+
"PYI047",
160+
"PYI049",
161+
"PYI053",
162+
"PYI054",
163+
"RET501",
164+
"SIM910",
165+
"N812",
166+
"PLC0415",
167+
"PLR0904",
168+
"PLR0913",
169+
"PLR2004",
170+
"PLR1711",
171+
"TRY003",
172+
"T20",
173+
"SIM105",
174+
"RET504",
175+
"PLR0912",
176+
"PLR0915",
177+
"TD",
178+
"TC001",
179+
"TC002",
180+
"TC003",
181+
"TC006",
182+
"PLW0603",
183+
"EM102",
184+
"PLW2901",
185+
"RSE102",
186+
"PGH004",
197187
"N806",
198-
"UP007",
199-
"UP038",
200-
]
201-
exclude = [
202-
"build",
203-
"tests/**",
188+
"FBT001",
204189
]
190+
exclude = ["build"]
205191

206192
[tool.ruff.lint.per-file-ignores]
207193
"__init__.py" = [
208194
"F401", # Unused import
209195
"E402", # Module import not at top of file
210196
]
197+
"**/tests/**/*.py" = [
198+
"S104",
199+
"S105",
200+
"S106",
201+
"TRY004",
202+
"RUF003",
203+
"RUF012",
204+
"UP031",
205+
"SLF001",
206+
"ARG",
207+
"N806",
208+
"ANN001",
209+
"ANN201",
210+
"ANN202",
211+
"ANN204",
212+
"ANN401",
213+
"S",
214+
"INP001",
215+
"PLW0108",
216+
"EM102",
217+
"FBT001",
218+
"SIM300",
219+
"FLY002",
220+
"A002",
221+
"A004",
222+
]
223+
"examples/*.py" = ["INP001"]
224+
225+
[tool.ruff.lint.pep8-naming]
226+
classmethod-decorators = [
227+
"pydantic.validator",
228+
"declared_attr",
229+
"expression",
230+
"comparator",
231+
]
232+
233+
[tool.ruff.lint.flake8-builtins]
234+
ignorelist = ["id", "input"]
235+
236+
[tool.ruff.lint.flake8-type-checking]
237+
runtime-evaluated-base-classes = [
238+
"pydantic.BaseModel",
239+
"sqlalchemy.orm.DeclarativeBase",
240+
]
211241

212242
[tool.ruff.format]
213243
quote-style = "double"

0 commit comments

Comments
 (0)