[tool.ruff] # Same as Black. line-length = 88 # Assume Python 3.10. target-version = "py310" # Exclude a variety of commonly ignored directories. exclude = [ ".bzr", ".direnv", ".eggs", ".git", ".git-rewrite", ".hg", ".mypy_cache", ".nox", ".pants.d", ".pytype", ".ruff_cache", ".svn", ".tox", ".venv", "__pypackages__", "_build", "buck-out", "build", "dist", "node_modules", "venv", ] [tool.ruff.lint] # Enable flake8-bugbear (`B`) rules. select = ["E", "F", "B", "I"] ignore = ["B008"] # Ignore function calls in argument defaults (common in FastAPI) # Allow unused variables when underscore-prefixed. dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" [tool.ruff.lint.mccabe] # Unlike Flake8, default to a complexity level of 10. max-complexity = 10 [tool.ruff.lint.isort] known-third-party = ["fastapi", "pydantic", "sqlalchemy", "alembic", "starlette"]