Files
writer-work-flow/pyproject.toml
Yaojia Wang a02c6b6e4f test: 接入覆盖率工具并在 CI 强制 ≥80% 门禁
后端: 加 pytest-cov + [tool.coverage] 配置, pytest --cov-fail-under=80 (基线~88%)。
前端: 加 @vitest/coverage-v8, vitest.config.ts 设 80% 阈值, 新增 test:coverage 脚本 (基线~93%)。
前端覆盖范围限定 lib/** 纯逻辑层; hooks(use*.ts)待 jsdom 测试栈接入后纳入。
CI backend/frontend job 改跑覆盖率门禁命令。CLAUDE.md 同步 DoD 与 Toolchain。
2026-06-26 21:11:57 +02:00

75 lines
1.5 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[tool.uv.workspace]
members = [
"apps/api",
"packages/shared",
"packages/config",
"packages/db",
"packages/llm_gateway",
"packages/core",
"packages/agents",
"packages/skills",
]
[dependency-groups]
dev = [
"pytest>=8",
"pytest-asyncio>=0.24",
"pytest-cov>=5",
"ruff>=0.6",
"mypy>=1.11",
"httpx>=0.27",
"asgi-lifespan>=2.1",
]
[tool.ruff]
line-length = 100
target-version = "py312"
src = ["apps", "packages"]
[tool.ruff.lint]
select = ["E", "F", "I", "UP", "B"]
[tool.mypy]
python_version = "3.12"
mypy_path = [
"packages/shared",
"packages/config",
"packages/db",
"packages/llm_gateway",
"packages/core",
"packages/agents",
"packages/skills",
"apps/api",
]
namespace_packages = true
strict = true
ignore_missing_imports = true
explicit_package_bases = true
# 跨包聚合 mypy 时,多个无包 tests 目录的 conftest.py 会撞成同名模块 `conftest`。
# conftest 仅含测试 fixtures从聚合检查中排除test_*.py / fakes_* 仍按唯一名受检)。
exclude = ["(^|/)conftest\\.py$"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests", "apps", "packages"]
[tool.coverage.run]
branch = true
source = ["apps", "packages"]
omit = [
"*/tests/*",
"*/conftest.py",
"*/migrations/*",
"*/alembic/*",
]
[tool.coverage.report]
show_missing = true
# 排除无需覆盖的纯防御/类型分支
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"@(abc\\.)?abstractmethod",
]