[tool.ruff] line-length = 100 target-version = "py310" extend-exclude = ["alembic/versions"] [tool.ruff.lint] select = ["E", "F", "I", "UP", "B", "ASYNC", "S", "C4", "SIM"] ignore = ["S101"] # 测试里允许 assert [tool.ruff.lint.per-file-ignores] "tests/*" = ["S105", "S106"] # 测试里的假令牌/假口令 "alembic/env.py" = ["E402"] # conftest 必须在 import 任何 app 模块之前写好环境变量(否则配置已被缓存), # 因此 import 语句不能提到文件顶部。 "tests/conftest.py" = ["E402"] [tool.ruff.lint.isort] known-first-party = ["app"] [tool.pytest.ini_options] asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "function" testpaths = ["tests"] addopts = "-q --strict-markers" filterwarnings = ["ignore::DeprecationWarning"]