Merge branch 'refactor/backend-architecture' into development
This commit is contained in:
@@ -134,10 +134,27 @@ api/
|
||||
|
||||
用 `uv sync --dev` 安装全部依赖(含 dev),`uv.lock` 纳入版本控制。不在 `addopts` 中全局过滤 marker。
|
||||
|
||||
当前开发工具链职责约定:
|
||||
|
||||
- `ruff`:负责 `lint` + `format`
|
||||
- `pytest`:统一测试入口
|
||||
- `pytest-asyncio`:负责 `async def` 测试和异步 fixture
|
||||
- `pytest-cov`:负责覆盖率统计
|
||||
- `pyright`:负责类型检查,但不替代测试和 `lint`
|
||||
|
||||
### 3.2 Makefile
|
||||
|
||||
```makefile
|
||||
.PHONY: test test-unit test-integration test-all test-cov
|
||||
.PHONY: lint format typecheck test test-unit test-integration test-all test-cov
|
||||
|
||||
lint: ## 代码检查
|
||||
uv run ruff check .
|
||||
|
||||
format: ## 代码格式化
|
||||
uv run ruff format .
|
||||
|
||||
typecheck: ## 类型检查
|
||||
uv run pyright
|
||||
|
||||
test: test-unit ## 默认只跑 unit
|
||||
|
||||
@@ -557,3 +574,4 @@ jobs:
|
||||
10. **默认命令 `make test`**(unit),`make test-all` 全部
|
||||
11. **测试目录无 `__init__.py`**
|
||||
12. **依赖通过 uv 管理**:`uv sync --dev` 安装,`uv add --dev <pkg>` 新增 dev 依赖,禁止 `pip install`
|
||||
13. **类型检查由 `pyright` 负责**:它用于发现静态类型问题,但不能替代 `ruff` 或 `pytest`
|
||||
|
||||
Reference in New Issue
Block a user