chore: add pre-commit hook recipes #32

Merged
David merged 2 commits from chore/pre-commit-hooks into main 2026-06-13 12:48:27 +02:00
Owner

Adds the governance opt-in pre-commit hook recipes ([group: 'hooks']) from governance/PRE_COMMIT.md to this repo's justfile, using Variant B (ad-hoc docker run, no compose.dev.yml) against the rust-builder-glibc image so a local just pre-commit runs the exact CI toolchain.

install-hooks writes a .git/hooks/pre-commit stub that execs just pre-commit (run once per fresh clone, bypass any single commit with git commit --no-verify).

pre-commit mirrors .forgejo/workflows/check.yml byte-for-byte in order: cargo fmt --check, cargo clippy --all-targets --features server -- -D warnings, cargo check --features server, cargo check --target wasm32-unknown-unknown, then cargo test --features server --bin vervain-app, each as its own docker run with the shared dev-vervain-apps-cargo-target and dev-vervain-apps-cargo-registry named volumes for incremental cache.

This is a mixed-language repo (Rust/Dioxus + bun/Tailwind), so the recipe runs the Tailwind build FIRST: assets/tailwind-built.css is gitignored/generated and is embedded by asset!() in src/main.rs:70, so the cargo steps fail without it. The rust-builder image has no bun, so the CSS is built on the HOST exactly as the repo builds it (bun install --frozen-lockfile then bun run tailwindcss --input assets/tailwind.css --output assets/tailwind-built.css --minify, matching the build-css recipe and the check.yml Build Tailwind CSS step) before the cargo steps run in Docker.

Defines dev_image := "ghcr.io/niceguyit/rust-builder-glibc:v1.0.1-rust1.94-trixie" near the top of the justfile. Opt-in dev tooling only; no behavior change to CI or the app. Validated with just --list (exit 0, shows the [hooks] group). No YouTrack issue per the request.

🤖 Generated with Claude Code

Adds the governance opt-in pre-commit hook recipes (`[group: 'hooks']`) from `governance/PRE_COMMIT.md` to this repo's `justfile`, using Variant B (ad-hoc `docker run`, no `compose.dev.yml`) against the `rust-builder-glibc` image so a local `just pre-commit` runs the exact CI toolchain. `install-hooks` writes a `.git/hooks/pre-commit` stub that execs `just pre-commit` (run once per fresh clone, bypass any single commit with `git commit --no-verify`). `pre-commit` mirrors `.forgejo/workflows/check.yml` byte-for-byte in order: cargo fmt --check, cargo clippy --all-targets --features server -- -D warnings, cargo check --features server, cargo check --target wasm32-unknown-unknown, then cargo test --features server --bin vervain-app, each as its own `docker run` with the shared `dev-vervain-apps-cargo-target` and `dev-vervain-apps-cargo-registry` named volumes for incremental cache. This is a mixed-language repo (Rust/Dioxus + bun/Tailwind), so the recipe runs the Tailwind build FIRST: `assets/tailwind-built.css` is gitignored/generated and is embedded by `asset!()` in `src/main.rs:70`, so the cargo steps fail without it. The rust-builder image has no bun, so the CSS is built on the HOST exactly as the repo builds it (`bun install --frozen-lockfile` then `bun run tailwindcss --input assets/tailwind.css --output assets/tailwind-built.css --minify`, matching the `build-css` recipe and the check.yml Build Tailwind CSS step) before the cargo steps run in Docker. Defines `dev_image := "ghcr.io/niceguyit/rust-builder-glibc:v1.0.1-rust1.94-trixie"` near the top of the `justfile`. Opt-in dev tooling only; no behavior change to CI or the app. Validated with `just --list` (exit 0, shows the `[hooks]` group). No YouTrack issue per the request. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
chore: add install-hooks and pre-commit just recipes
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 1m39s
3afb99c5fc
Add the governance `[group: 'hooks']` recipes from governance/PRE_COMMIT.md: `install-hooks` writes a `.git/hooks/pre-commit` stub that execs `just pre-commit`, and `pre-commit` mirrors `.forgejo/workflows/check.yml` step-for-step (Tailwind build prerequisite plus fmt, clippy, server + wasm checks, tests) in the rust-builder-glibc image so CI failures surface locally before push.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge branch 'main' into chore/pre-commit-hooks
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / fmt + clippy + build + tests (pull_request) Successful in 1m16s
09d9721043
David merged commit e6ac94f9e8 into main 2026-06-13 12:48:27 +02:00
David deleted branch chore/pre-commit-hooks 2026-06-13 12:48:28 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/vervain-apps!32
No description provided.