Files
IronFox/scripts/git-hooks/pre-commit
T
celenity c0f514d64e fix: update shellcheck/shfmt handling and set-up
Notably:

- We now always provide our own copies of both `shellcheck` and `shfmt` (via `get_sources.sh`)
- Set-up of the pre-commit hook is now at `lint-hook.sh`, so we can call it directly (and give users a way to set-up the hook directly if necessary)
- The `lint` CI stage is now performed on Fedora instead of Alpine (like the rest of the build process), but only the minimal set-up is performed to download and set-up the necessary tools

Signed-off-by: celenity <celenity@celenity.dev>
2026-08-03 05:07:06 +00:00

16 lines
536 B
Bash
Executable File

#!/bin/bash
# IronFox pre-commit hook: lints staged shell scripts with shellcheck + shfmt.
#
# Enabled by pointing git at this directory (done automatically by
# scripts/lint-hook.sh):
# git config core.hooksPath scripts/git-hooks
#
# This is a convenience only. It can be bypassed with `git commit --no-verify`,
# and it is not installed on fresh clones until bootstrap runs — so CI (the
# `lint-scripts` job) remains the real enforcement gate.
set -euo pipefail
exec "$(git rev-parse --show-toplevel)/scripts/lint.sh" --staged