File size: 1,463 Bytes
7302343 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | # Ruff config — engine/
# Style: strict. Detail: docs/14-Engineering.md §3.1
target-version = "py311"
line-length = 100
[lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # bugbear
"C4", # comprehensions
"UP", # pyupgrade
"ASYNC", # async patterns
"S", # security
"TID", # tidy imports
"TCH", # type-checking blocks
"RUF", # ruff-specific
"PL", # pylint subset
"SIM", # simplify
]
ignore = [
"S101", # assert in tests is fine
"PLR2004", # magic numbers — too noisy at MVP
]
[lint.flake8-tidy-imports]
ban-relative-imports = "all"
# === Layer purity — invariant I-8 ===
# engine/ must never import from devvit-app/
[lint.flake8-tidy-imports.banned-api]
"devvit_app".msg = "Layer violation: engine cannot import from devvit-app/. See docs/Specs.md §4.2."
[lint.per-file-ignores]
# Tests use literal "secrets", inline imports for monkeypatched env, and assertions.
"test_*.py" = ["S101", "S105", "S106", "PLR2004", "ASYNC", "PLC0415"]
"__init__.py" = ["F401"]
# Alembic auto-generated migration files: long lines + trailing whitespace are fine.
"alembic/versions/*.py" = ["E501", "W291", "I001"]
[lint.isort]
known-first-party = ["api", "orchestrator", "tools", "llm", "memory", "store", "observability"]
[format]
quote-style = "double"
indent-style = "space"
docstring-code-format = true
|