@@ -237,31 +237,54 @@ exclude_lines = [
237
237
]
238
238
239
239
[tool .ruff ]
240
+ include = [" dspy/**/*.py" , " tests/**/*.py" ]
241
+
242
+
240
243
line-length = 120
241
244
indent-width = 4
242
245
target-version = " py39"
243
246
244
247
[tool .ruff .lint ]
245
- # Select a minimal set of rules
246
248
select = [
247
- " F" , # Pyflakes
248
- " E" , # Pycodestyle
249
- " TID252" , # Absolute imports
250
-
249
+ " E" , # pycodestyle errors
250
+ " W" , # pycodestyle warnings
251
+ " F" , # pyflakes
252
+ " I" , # isort
253
+ " C" , # flake8-comprehensions
254
+ " B" , # flake8-bugbear
255
+ " UP" , # ≈
256
+ " N" , # pep8-naming
257
+ " RUF" , # ruff-specific rules
251
258
]
252
- ignore = [
253
- " E501" , # Line too long
254
259
260
+ ignore = [
261
+ " B027" , # Allow non-abstract empty methods in abstract base classes
262
+ " FBT003" ,# Allow boolean positional values in function calls
263
+ " C901" , # Ignore complexity checking
264
+ " E501" , # Ignore line length errors (handled by formatter)
255
265
]
266
+
256
267
# Allow fix for all enabled rules (when `--fix`) is provided.
257
268
fixable = [" ALL" ]
258
269
unfixable = []
259
270
260
271
[tool .ruff .format ]
261
272
docstring-code-format = false
273
+ quote-style = " double"
262
274
indent-style = " space"
275
+ skip-magic-trailing-comma = false
263
276
line-ending = " auto"
264
277
278
+ [tool .ruff .lint .isort ]
279
+ known-first-party = [" dspy" ]
280
+
281
+ [tool .ruff .lint .flake8-tidy-imports ]
282
+ ban-relative-imports = " all"
283
+
265
284
[tool .ruff .lint .per-file-ignores ]
266
- "**/{tests,testing,docs}/*" = [" ALL" ]
267
- "**__init__.py" = [" ALL" ]
285
+ "tests/**/*.py" = [
286
+ " S101" , # Allow assert statements in tests
287
+ " TID252" , # Allow relative imports in tests
288
+ " ARG001" , # Allow unused arguments in tests (like pytest fixtures)
289
+ ]
290
+ "__init__.py" = [" F401" ] # Init files can be empty
0 commit comments