SummarizerApp / ruff.toml
ming
Migrate to Ruff for linting/formatting and add comprehensive import tests
29ed661
# Ruff configuration file
# Fast, Python linter and formatter written in Rust
# Line length (Black-compatible default)
line-length = 88
# Target Python version
target-version = "py310"
# Exclude patterns
exclude = [
"__pycache__",
"*.pyc",
".git",
".venv",
"venv",
"htmlcov",
".pytest_cache",
"dist",
"build",
]
# Linter configuration
[lint]
# Enable rule sets
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort (import sorting)
"UP", # pyupgrade
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"SIM", # flake8-simplify
]
# Ignore specific rules
ignore = [
"E501", # Line too long (handled by formatter)
"B008", # Do not perform function calls in argument defaults (common in FastAPI)
"C901", # Too complex (may be too strict for this project)
"B904", # Allow raising exceptions without 'from' in error handlers (FastAPI pattern)
]
# Per-file ignores
[lint.per-file-ignores]
"tests/*" = ["S101"] # Use of assert in tests is fine
"app/services/structured_summarizer.py" = ["E402", "E722"] # Intentional imports after patch, bare except for JSON parsing
"app/services/summarizer.py" = ["SIM117"] # Nested async with necessary (client.stream depends on client context)
# Import sorting configuration (isort-compatible)
[lint.isort]
known-first-party = ["app"]
# Format configuration
[format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"