diff --git a/prek.toml b/prek.toml index 8642262b..d077be8f 100644 --- a/prek.toml +++ b/prek.toml @@ -76,6 +76,17 @@ hooks = [ # The wrapper is because `bash -n a.sh b.sh` checks only `a.sh` — the rest # become its positional arguments — so each file has to be handed over on # its own. + # plan/README.md says both of these run on a commit that touches plan/, and + # until now neither was wired: the register could disagree with the epics it + # is generated from and nothing said so until somebody read both. The two are + # separate hooks because they fail for different reasons — a malformed epic + # is fixed by editing it, and a stale register is fixed by running the + # generator and staging the result — and a single hook would have to explain + # both in one message. Both read all of plan/ whatever they are handed, so + # neither takes filenames, and the scripts are inputs as much as the epics + # are: a change to the frontmatter parser can stale the register on its own. + { id = "check-plan", name = "check plan", entry = "scripts/check-plan.py", language = "system", files = '^(plan/.*|scripts/check-plan\.py)$', pass_filenames = false, stages = ["pre-commit"] }, + { id = "plan-register", name = "plan register", entry = "scripts/gen-plan-readme.py --check", language = "system", files = '^(plan/.*|scripts/(check-plan|gen-plan-readme)\.py)$', pass_filenames = false, stages = ["pre-commit"] }, { id = "shell-parse", name = "shell parse", entry = "bash -c 'for f in \"$@\"; do bash -n \"$f\" || exit 1; done' _", language = "system", files = '^scripts/.*\.sh$', stages = ["pre-commit"] }, { id = "lexicon-tests", name = "lexicon tests", entry = "cargo test -p vibescrobble-lexicon --all-features", language = "system", types = ["file"], files = '^lexicons/.*\.json$', pass_filenames = false, stages = ["pre-commit"] }, ]