@@ -109,27 +109,54 @@ exclude_lines = [
109
109
]
110
110
111
111
[tool .ruff ]
112
+ include = [" dspy/**/*.py" , " tests/**/*.py" ]
113
+
114
+
112
115
line-length = 120
113
116
indent-width = 4
114
117
target-version = " py39"
115
118
116
119
[tool .ruff .lint ]
117
120
select = [
118
- " F" , # Pyflakes
119
- " E" , # Pycodestyle
120
- " TID252" , # Absolute imports
121
+ " E" , # pycodestyle errors
122
+ " W" , # pycodestyle warnings
123
+ " F" , # pyflakes
124
+ " I" , # isort
125
+ " C" , # flake8-comprehensions
126
+ " B" , # flake8-bugbear
127
+ " UP" , # ≈
128
+ " N" , # pep8-naming
129
+ " RUF" , # ruff-specific rules
121
130
]
131
+
122
132
ignore = [
123
- " E501" , # Line too long
133
+ " B027" , # Allow non-abstract empty methods in abstract base classes
134
+ " FBT003" ,# Allow boolean positional values in function calls
135
+ " C901" , # Ignore complexity checking
136
+ " E501" , # Ignore line length errors (handled by formatter)
124
137
]
138
+
139
+ # Allow fix for all enabled rules (when `--fix`) is provided.
125
140
fixable = [" ALL" ]
126
141
unfixable = []
127
142
128
143
[tool .ruff .format ]
129
144
docstring-code-format = false
145
+ quote-style = " double"
130
146
indent-style = " space"
147
+ skip-magic-trailing-comma = false
131
148
line-ending = " auto"
132
149
150
+ [tool .ruff .lint .isort ]
151
+ known-first-party = [" dspy" ]
152
+
153
+ [tool .ruff .lint .flake8-tidy-imports ]
154
+ ban-relative-imports = " all"
155
+
133
156
[tool .ruff .lint .per-file-ignores ]
134
- "**/{tests,testing,docs}/*" = [" ALL" ]
135
- "**__init__.py" = [" ALL" ]
157
+ "tests/**/*.py" = [
158
+ " S101" , # Allow assert statements in tests
159
+ " TID252" , # Allow relative imports in tests
160
+ " ARG001" , # Allow unused arguments in tests (like pytest fixtures)
161
+ ]
162
+ "__init__.py" = [" F401" ] # Init files can be empty
0 commit comments