From 163de8bf255ec2beeb3faa3e730940a617533a99 Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Fri, 13 Feb 2026 17:42:22 +0100 Subject: [PATCH] =?UTF-8?q?fix(ci):=20address=20PR=20review=20=E2=80=94=20?= =?UTF-8?q?filter=20comments,=20trim=20whitespace,=20warn=20on=20missing?= =?UTF-8?q?=20scripts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Filter YAML comment lines (grep -v '^\s*#') from both extraction pipelines to prevent phantom canonical IDs - Trim trailing whitespace from extracted fact_ids so grep -qxF exact match works reliably - Pre-commit dispatcher now prints explicit warning when a check script is missing instead of silently skipping - Document --no-verify bypass for emergencies in DEVOPS.md Co-Authored-By: Claude Opus 4.6 --- .config/hooks/pre-commit | 3 ++- docs/DEVOPS.md | 6 ++++++ tooling/check-fact-ids | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) 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