mirror of
https://github.com/kuhyx/scripts.git
synced 2026-07-04 15:03:09 +02:00
chore: enforce shell_check via tracked pre-commit hook
This commit is contained in:
parent
8c1fe9e7a1
commit
38b4214cfb
16
.githooks/pre-commit
Executable file
16
.githooks/pre-commit
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
repo_root=$(git rev-parse --show-toplevel)
|
||||||
|
cd "$repo_root"
|
||||||
|
|
||||||
|
printf 'Running shell_check before committing...\n'
|
||||||
|
|
||||||
|
if ! scripts/meta/shell_check.sh --skip-install; then
|
||||||
|
printf '\nCommit aborted: shell_check reported issues.\n' >&2
|
||||||
|
printf 'Fix the lint problems and retry the commit.\n' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
printf 'shell_check passed. Proceeding with commit.\n'
|
||||||
Loading…
Reference in New Issue
Block a user