Skip to content

Commit 575443f

Browse files
enable style check
1 parent 79b8808 commit 575443f

File tree

1 file changed

+32
-9
lines changed

1 file changed

+32
-9
lines changed

pyproject.toml

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,31 +237,54 @@ exclude_lines = [
237237
]
238238

239239
[tool.ruff]
240+
include = ["dspy/**/*.py", "tests/**/*.py"]
241+
242+
240243
line-length = 120
241244
indent-width = 4
242245
target-version = "py39"
243246

244247
[tool.ruff.lint]
245-
# Select a minimal set of rules
246248
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
251258
]
252-
ignore = [
253-
"E501", # Line too long
254259

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)
255265
]
266+
256267
# Allow fix for all enabled rules (when `--fix`) is provided.
257268
fixable = ["ALL"]
258269
unfixable = []
259270

260271
[tool.ruff.format]
261272
docstring-code-format = false
273+
quote-style = "double"
262274
indent-style = "space"
275+
skip-magic-trailing-comma = false
263276
line-ending = "auto"
264277

278+
[tool.ruff.lint.isort]
279+
known-first-party = ["dspy"]
280+
281+
[tool.ruff.lint.flake8-tidy-imports]
282+
ban-relative-imports = "all"
283+
265284
[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

Comments
 (0)