ci(lint): enforce ruff format --check in pre-commit hook and flake check
- .githooks/pre-commit: add ruff format --check . alongside ruff check, pyright, and pytest - flake.nix: add ruff format --check . to packages.default preCheck - AGENTS.md: update Section 5 verification rules to include ruff format --check
This commit is contained in:
1 parent
165a6c28da
commit
a5d69eb37d
3 files changed
+5
-3
No files matched your search
@@ -3,8 +3,9 @@ set -euo pipefail
|
||||
|
||||
if command -v ruff >/dev/null 2>&1 && command -v pyright >/dev/null 2>&1 && command -v pytest >/dev/null 2>&1; then
|
||||
ruff check .
|
||||
ruff format --check .
|
||||
pyright
|
||||
pytest
|
||||
else
|
||||
nix develop --command bash -c "ruff check . && pyright && pytest"
|
||||
nix develop --command bash -c "ruff check . && ruff format --check . && pyright && pytest"
|
||||
fi
|
||||
@@ -45,7 +45,7 @@ The working tree represents the user's active work.
|
||||
## 5. Verification, Hooks & CI Expectations
|
||||
|
||||
Every task and commit must pass automated verification inside `nix develop`:
|
||||
1. **Local Pre-Commit Hook (`.githooks/pre-commit`):** Configured automatically by `flake.nix` `shellHook` (`git config core.hooksPath .githooks`). Runs `ruff check .`, `pyright`, and `pytest` before every commit. Never bypass hooks with `--no-verify`.
|
||||
1. **Local Pre-Commit Hook (`.githooks/pre-commit`):** Configured automatically by `flake.nix` `shellHook` (`git config core.hooksPath .githooks`). Runs `ruff check .`, `ruff format --check .`, `pyright`, and `pytest` before every commit. Never bypass hooks with `--no-verify`.
|
||||
2. **TDD Red-Phase Commits (`@pytest.mark.xfail`):** When committing Red-phase tests before the feature implementation exists, provide typed symbol stubs (`raise NotImplementedError`) so `pyright` passes, and decorate unimplemented tests with `@pytest.mark.xfail(strict=True, reason="Red phase: ...")` so `pytest` and `.githooks/pre-commit` exit `0` while still failing if a Red test passes tautologically. Remove `xfail` in the Green-phase commit.
|
||||
3. **Server-Side Gitea Actions CI (`.gitea/workflows/ci.yaml`):** Runs `nix flake check` on every push and pull request targeting `main`, executing `ruff check .`, `pyright`, `pytestCheckHook`, and `buildPythonApplication` inside the isolated Nix sandbox. Verify `nix flake check` locally before opening or updating a pull request.
|
||||
3. **Server-Side Gitea Actions CI (`.gitea/workflows/ci.yaml`):** Runs `nix flake check` on every push and pull request targeting `main`, executing `ruff check .`, `ruff format --check .`, `pyright`, `pytestCheckHook`, and `buildPythonApplication` inside the isolated Nix sandbox. Verify `nix flake check` locally before opening or updating a pull request.
|
||||
4. **Completion Reporting:** Report: (1) What changed, (2) Files modified/created, (3) Verification performed, (4) Unverified areas/risks.
|
||||
Reference in new issue
Block a user