diff --git a/README.md b/README.md index b22acc7..8ea2f3a 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,16 @@ Host requirements: `curl`, `tar`, `unzip`, `sha256sum`, and **`fontconfig`** "Fontconfig head is null" — bootstrap warns rather than failing, so the message is easy to miss. +## Pre-commit hooks + +Hooks are managed by [prek](https://prek.j178.dev/) and configured in +`prek.toml`. One-time setup: + + uv tool install prek + prek install --prepare-hooks + +They then run on every commit; `prek run --all-files` runs them by hand. + ## Patches Unified diffs in `patches/patchset/`, applied `-p1` against a pristine tree — diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..6f5c0b6 --- /dev/null +++ b/prek.toml @@ -0,0 +1,19 @@ +# Hooks for prek (https://prek.j178.dev/). See README for setup. +# The .patch excludes: patch hunks carry meaningful whitespace. results/ is +# archival spike data and is left untouched. + +[[repos]] +repo = "https://github.com/pre-commit/pre-commit-hooks" +rev = "v6.0.0" +hooks = [ + { id = "check-merge-conflict" }, + { id = "check-added-large-files" }, + { id = "mixed-line-ending", args = ["--fix=lf"], exclude = '\.patch$|^results/' }, + { id = "end-of-file-fixer", exclude = '\.patch$|^results/' }, + { id = "trailing-whitespace", exclude = '\.patch$|^results/' }, +] + +[[repos]] +repo = "https://github.com/shellcheck-py/shellcheck-py" +rev = "v0.11.0.1" +hooks = [{ id = "shellcheck" }]