@@ -221,3 +221,45 @@ name = "ads" # name for local build and import, see https://flit.pypa.io/en/late
221221# By default `ads` folder and `LICENSE.txt` file included in sdist. Folders `docs` and `tests` are excluded, as weel as other project files
222222# Use this section to include/exclude files and folders. See doc: https://flit.pypa.io/en/latest/pyproject_toml.html#sdist-section
223223include = [" THIRD_PARTY_LICENSES.txt" ]
224+
225+ # Configuring Ruff (https://docs.astral.sh/ruff/configuration/)
226+ [tool .ruff ]
227+ fix = true
228+
229+ [tool .ruff .lint ]
230+ exclude = [" *.yaml" , " *jinja2" ]
231+ # rules - https://docs.astral.sh/ruff/rules/
232+ extend-ignore = [" E402" , " N806" , " N803" ]
233+ ignore = [
234+ " S101" , # use of assert
235+ " B008" , # function call in argument defaults
236+ " B017" , # pytest.raises considered evil
237+ " B023" , # function definition in loop (TODO: un-ignore this)
238+ " B028" , # explicit stacklevel for warnings
239+ " C901" , # function is too complex (TODO: un-ignore this)
240+ " E501" , # from scripts/lint_backend.sh
241+ " PLR091" , # complexity rules
242+ " PLR2004" , # magic numbers
243+ " PLW2901" , # `for` loop variable overwritten by assignment target
244+ " SIM105" , # contextlib.suppress (has a performance cost)
245+ " SIM117" , # multiple nested with blocks (doesn't look good with gr.Row etc)
246+ " UP006" , # use `list` instead of `List` for type annotations (fails for 3.8)
247+ " UP007" , # use X | Y for type annotations (TODO: can be enabled once Pydantic plays nice with them)
248+ ]
249+ extend-select = [
250+ " ARG" ,
251+ " B" ,
252+ " C" ,
253+ " E" ,
254+ " F" ,
255+ " I" ,
256+ " N" ,
257+ " PL" ,
258+ " S101" ,
259+ " SIM" ,
260+ " UP" ,
261+ " W" ,
262+ ]
263+
264+ [tool .ruff .lint .per-file-ignores ]
265+ "__init__.py" = [" F401" ]
0 commit comments