-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpre-commit
More file actions
20 lines (18 loc) · 848 Bytes
/
Copy pathpre-commit
File metadata and controls
20 lines (18 loc) · 848 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
# Warn-only design-slop check for the Engraphis dashboard.
#
# Runs ONLY when engraphis/static/index.html is staged, and NEVER blocks the
# commit — it prints a summary and always exits 0. Warn-only is deliberate: the
# automated development workflows may commit, and a blocking hook would break
# those unattended commits. For a hard gate on your own manual commits, run
# `bash scripts/design-lint.sh --strict` yourself before committing.
#
# Enable once, from the repo root (survives on Windows / Git Bash too):
# git config core.hooksPath .githooks
set -uo pipefail
staged="$(git diff --cached --name-only 2>/dev/null || true)"
printf '%s\n' "$staged" | grep -q 'engraphis/static/index\.html' || exit 0
if [ -f scripts/design-lint.sh ]; then
bash scripts/design-lint.sh engraphis/static/index.html || true
fi
exit 0