Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ repos:
hooks:
- id: check-format
name: Check Ruff formatting
entry: ruff format --check .
entry: pdm run format:check
language: system
files: ^(.*\.py|pyproject\.toml|ruff\.toml)$
exclude: ^(cli/|\.agents/)
exclude: ^(cli/|\.agents/|tasks/)
pass_filenames: false
- id: check-lint
name: Check Ruff lint
entry: pdm run lint
language: system
files: ^(.*\.py|pyproject\.toml|ruff\.toml|\.pre-commit-config\.yaml)$
exclude: ^(cli/|\.agents/|tasks/)
pass_filenames: false
- id: typecheck
name: Check Pyrefly types
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ bugs that do not cross a security boundary.
```bash
git submodule update --init --recursive
pdm install -G dev --frozen-lockfile
pdm run pre-commit install
pdm run doctor
pdm run check
```

`.python-version` is the shared Python runtime anchor. CI installs PDM 2.28.0, and
`doctor` reports a mismatch when the local toolchain does not match that contract.

Git hook 需要在每个本地 checkout 安装;提交前会执行与 CI 相同的格式和 lint 入口。
移动仓库目录后,需要重建含旧绝对路径的虚拟环境入口并重新安装 hook;CI 的完整
`check` 仍是交付检查依据。

`check` is the same hermetic repository gate used by CI. It verifies the lock and
requirements export, migration configuration and append-only baseline, Ruff formatting,
repository lint, and static types. Use narrower commands while iterating:
Expand Down
2 changes: 2 additions & 0 deletions docs/40-deployment/development-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ pdm run dev
repository contract checks tool versions, lock/export consistency, migration integrity,
formatting, lint, settings isolation, and the complete unit-test suite.

格式与 lint 的范围由 `ruff.toml` 拥有,覆盖正式源码、测试与脚本。`tasks/` 是临时实验材料,`.agents/` 是独立维护的技能;二者不参与产品门禁。成为正式验证步骤的实验应迁入 `scripts/` 或 `tests/`。已发布迁移保持不可变;独立 CLI 使用 `pdm run --project cli check` 及自己的 CI。pre-commit 的格式与 lint 钩子复用 `pdm run format:check` 和 `pdm run lint`,CI 的完整入口仍为 `pdm run check`。

Use narrower read-only checks while iterating:

```bash
Expand Down
3 changes: 2 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
line-length = 92
indent-width = 2
extend-exclude = ["migrations/versions", "*.md", "cli", ".agents"]
# Task probes are disposable evidence; maintained checks belong in scripts/ or tests/.
extend-exclude = ["migrations/versions", "*.md", "cli", ".agents", "tasks"]

[format]
indent-style = "space"
Expand Down
Loading