59 lines
1.3 KiB
TOML
59 lines
1.3 KiB
TOML
# Ruff configuration for ML Projects monorepo
|
|
# https://docs.astral.sh/ruff/configuration/
|
|
|
|
# Target Python version
|
|
target-version = "py310"
|
|
|
|
# Line length
|
|
line-length = 88
|
|
|
|
# Exclude common directories
|
|
exclude = [
|
|
".git",
|
|
".venv",
|
|
"__pycache__",
|
|
".pytest_cache",
|
|
"build",
|
|
"dist",
|
|
"*.egg-info",
|
|
]
|
|
|
|
[lint]
|
|
# Enable rules
|
|
select = [
|
|
"E", # pycodestyle errors
|
|
"F", # pyflakes
|
|
"W", # pycodestyle warnings
|
|
"I", # isort
|
|
"UP", # pyupgrade
|
|
"B", # flake8-bugbear
|
|
"SIM", # flake8-simplify
|
|
"RUF", # ruff-specific rules
|
|
]
|
|
|
|
ignore = [
|
|
"E501", # line too long (handled by formatter)
|
|
"B008", # function call in default argument (common in FastAPI)
|
|
"B905", # zip without strict= (Python 3.10+ strict is optional)
|
|
]
|
|
|
|
[lint.per-file-ignores]
|
|
# Allow unused imports in __init__.py (re-exports)
|
|
"__init__.py" = ["F401"]
|
|
# Tests can use assert and magic values
|
|
"tests/**/*.py" = ["S101", "PLR2004"]
|
|
|
|
[lint.isort]
|
|
known-first-party = ["modules"]
|
|
force-single-line = false
|
|
combine-as-imports = true
|
|
|
|
[format]
|
|
# Use double quotes for strings
|
|
quote-style = "double"
|
|
# Indent with spaces
|
|
indent-style = "space"
|
|
# Respect magic trailing commas
|
|
skip-magic-trailing-comma = false
|
|
# Unix-style line endings
|
|
line-ending = "auto"
|