diff --git a/.config/hooks/pre-commit b/.config/hooks/pre-commit index 6e3843c83..bb5bc7e6c 100755 --- a/.config/hooks/pre-commit +++ b/.config/hooks/pre-commit @@ -14,7 +14,8 @@ run_check() { ERRORS=$((ERRORS + 1)) fi else - echo "pre-commit: skipping $label ($script not found or not executable)" + echo "pre-commit: WARNING — $label skipped ($script not found or not executable)" + echo " Run 'make setup' or check that $script exists and is executable." fi } diff --git a/docs/DEVOPS.md b/docs/DEVOPS.md index 7624f5c42..8d6c3a0ae 100644 --- a/docs/DEVOPS.md +++ b/docs/DEVOPS.md @@ -129,6 +129,12 @@ Active checks: The `core.hooksPath` setting uses a relative path (`.config/hooks`) that resolves per worktree, so it works correctly across all worktrees in the repository. +To bypass hooks in an emergency: + +```bash +git commit --no-verify -m "fix: emergency hotfix" +``` + ## Configuration Files The `.config/` directory holds shared configuration for linters, formatters, and CI. Examples of what goes here: diff --git a/tooling/check-fact-ids b/tooling/check-fact-ids index 4fb843755..8472b1450 100755 --- a/tooling/check-fact-ids +++ b/tooling/check-fact-ids @@ -22,9 +22,11 @@ if [ -d "$KNOWLEDGE_DIR" ]; then grep -rh 'fact_id:\s*' "$KNOWLEDGE_DIR" \ --include='*.yaml' \ --exclude='entity-attributes.yaml' \ + | grep -v '^\s*#' \ | sed 's/.*fact_id:\s*//' \ | sed 's/\s*#.*//' \ | sed "s/^[\"']\(.*\)[\"']$/\1/" \ + | sed 's/[[:space:]]*$//' \ | sort -u \ || true ) @@ -39,9 +41,11 @@ if [ -d "$CONTENT_DIR" ]; then REFERENCED=$( grep -rh 'fact_id:\s*' "$CONTENT_DIR" \ --include='*.yaml' \ + | grep -v '^\s*#' \ | sed 's/.*fact_id:\s*//' \ | sed 's/\s*#.*//' \ | sed "s/^[\"']\(.*\)[\"']$/\1/" \ + | sed 's/[[:space:]]*$//' \ || true ) fi