chore: Add pre-commit hook running shellcheck on every commit
Tests / tests (push) Successful in 3m11s

This commit is contained in:
alvinlollo
2026-10-13 18:07:05 +11:00
parent 6a708c0303
commit 3b1e7d1982
3 changed files with 76 additions and 1 deletions
+10
View File
@@ -97,6 +97,16 @@ yamllint -d "{extends: relaxed, rules: {document-start: disable, line-length: di
`packages.x86_64` syntax: one package per line, `[a-zA-Z0-9._@+\-]+` only, no trailing
whitespace.
A **pre-commit hook** (`githooks/pre-commit`) runs the same ShellCheck pass on every
commit, so CI failures surface before you push. Enable it once per clone:
```bash
git config core.hooksPath githooks
```
It skips linting (with a warning) when `shellcheck` is missing rather than blocking the
commit; CI remains the enforcer. Bypass it with `git commit --no-verify`.
## Gotchas
- The profile root is the **repo root** (not a `releng/` subdirectory). CI builds with `mkarchiso -v -w "$PWD/work" -o "$PWD/out" -- "$PWD"` (`.gitea/workflows/build-iso.yaml`), and the local build command above does the same — never pass a `releng` path.