Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

build: add mise git hooks (pre-commit: fmt+lint+test, pre-push: ci)

63b82c42d06e6023e92670bdcbf8bbeb873f44c4

Oliver Jan Krylow <oliver@bugabinga.net> · 2026-06-06 11:06 UTC

unsigned 1 parent

Changed files (2)

AGENTS.md

ready
@@ -35,6 +35,16 @@
escalate to a human.
Do not work around `mise` or add ad-hoc scripts.
+## Git Hooks
+
+- `pre-commit` — runs `fmt` + `lint` + `test`
+- `pre-push` — runs full `ci`
+
+Managed via `mise generate git-pre-commit`.
+To reinstall after clone:
+`mise generate git-pre-commit --write && mise generate git-pre-commit --hook
+pre-push --task pre-push --write`.
+
## Troubleshooting
If `mise run` tasks fail with command-not-found errors, run `mise doctor`.

mise.toml

ready
@@ -61,6 +61,14 @@
depends = ["ci"]
run = "PI_EXT_CI_DONE=1 python3 scripts/extensions.py publish \"$@\""
+[tasks.pre-commit]
+description = "Pre-commit hook: fmt + lint + test"
+run = ["mise run fmt", "mise run lint", "mise run test"]
+
+[tasks.pre-push]
+description = "Pre-push hook: full CI"
+run = "mise run ci"
+
[tasks.goal-pexpect]
description = "Run goal pexpect test"
run = "python3 -c 'import subprocess, sys; args = sys.argv[1:]; subprocess.run([\"python3\", \"scripts/test_goal_pexpect.py\", *(([\"--idea\", args[0], *args[1:]]) if args and not args[0].startswith(\"-\") else args)], check=True)'"