repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

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

63b82c42d06e6023e92670bdcbf8bbeb873f44c4

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (2)

AGENTS.md

Modified
35 35 escalate to a human.
36 36 Do not work around `mise` or add ad-hoc scripts.
38 +## Git Hooks
40 +- `pre-commit` — runs `fmt` + `lint` + `test`
41 +- `pre-push` — runs full `ci`
43 +Managed via `mise generate git-pre-commit`.
44 +To reinstall after clone:
45 +`mise generate git-pre-commit --write && mise generate git-pre-commit --hook
46 +pre-push --task pre-push --write`.
38 48 ## Troubleshooting
40 50 If `mise run` tasks fail with command-not-found errors, run `mise doctor`.

mise.toml

Modified
61 61 depends = ["ci"]
62 62 run = "PI_EXT_CI_DONE=1 python3 scripts/extensions.py publish \"$@\""
64 +[tasks.pre-commit]
65 +description = "Pre-commit hook: fmt + lint + test"
66 +run = ["mise run fmt", "mise run lint", "mise run test"]
68 +[tasks.pre-push]
69 +description = "Pre-push hook: full CI"
70 +run = "mise run ci"
64 72 [tasks.goal-pexpect]
65 73 description = "Run goal pexpect test"
66 74 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)'"