build: uv 工具链、检查命令与提交前检查
- pyproject:Python 3.12、ruff、pyright strict、pytest(live/gpu 标记)、import-linter; 首条导入契约:cadx 不导入 torch、sam2(design 0001 第 7 条) - Makefile:sync/fmt/test/check - pre-commit:gitleaks、拦截 data/runs/reference/reference-pdf/models 与 .env、ruff format - 空包 cadx 与一项导入测试,让 make check 能跑通 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
.PHONY: sync fmt test check
|
||||
|
||||
sync:
|
||||
uv sync
|
||||
|
||||
fmt:
|
||||
uv run ruff check --fix .
|
||||
uv run ruff format .
|
||||
|
||||
# 不花钱、不需要 GPU 的测试;make test 和 make check 共用。
|
||||
FREE_TESTS = not live and not gpu
|
||||
|
||||
test:
|
||||
uv run pytest -m "$(FREE_TESTS)"
|
||||
|
||||
# 每行单独执行;任何一步非零退出,make 就停止。
|
||||
check:
|
||||
uv run ruff check .
|
||||
uv run ruff format --check .
|
||||
uv run pyright
|
||||
uv run lint-imports
|
||||
uv run pytest -m "$(FREE_TESTS)"
|
||||
Reference in New Issue
Block a user