chore: add pre-commit hook recipes #191
Loading…
Reference in a new issue
No description provided.
Delete branch "chore/pre-commit-hooks"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the opt-in governance pre-commit hook recipes from
governance/PRE_COMMIT.md(compose-run variant A) to thejustfile. No behavior change to existing recipes; two new recipes land under a# ── Hooks ──divider in the[group: 'hooks']group.install-hooks(run once per fresh clone) writes a#!/usr/bin/env sh\nexec just pre-commit\nstub to.git/hooks/pre-commitand marks it executable; re-running overwrites any leftover symlink from an older install layout. Opt in withjust install-hooks; bypass a single commit withgit commit --no-verify.pre-commitmirrors.forgejo/workflows/check.ymlstep-for-step with byte-identical cargo args (cargo fmt --all --check, cargo clippy --all-targets -- -D warnings, cargo check --all-targets, cargo test --lib, cargo test --doc, then the nine integration test binaries with --test-threads=4), each run throughdocker compose --file compose.dev.yml run --rmagainst the devservercontainer so the toolchain matches CI.Steps 1-5 use
--no-deps(no DB needed); the integration step drops--no-depsso the composepostgresservice (adepends_onofserver, condition service_healthy) starts. Theserverservice already setsDATABASE_URL=postgres://...@postgres:5432/mokosh, so the integration step needs no-e DATABASE_URLoverride. Theserverservice does not setSQLX_OFFLINE, so the five compile/test steps (clippy, check, unit, doc, integration) pass-e SQLX_OFFLINE=trueto match CI's job-levelSQLX_OFFLINE: "true"; fmt does not compile so it is left bare.Validated with
just --list(exit 0; both recipes appear under[hooks]). No CI/docker/cargo build was run locally.🤖 Generated with Claude Code