fix(ci): address PR review — filter comments, trim whitespace, warn on missing scripts

- 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 <noreply@anthropic.com>
This commit is contained in:
2026-02-13 17:42:22 +01:00
co-authored by Claude Opus 4.6
parent fa3c473273
commit 163de8bf25
3 changed files with 12 additions and 1 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ run_check() {
ERRORS=$((ERRORS + 1)) ERRORS=$((ERRORS + 1))
fi fi
else 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 fi
} }
+6
View File
@@ -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. 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 ## Configuration Files
The `.config/` directory holds shared configuration for linters, formatters, and CI. Examples of what goes here: The `.config/` directory holds shared configuration for linters, formatters, and CI. Examples of what goes here:
+4
View File
@@ -22,9 +22,11 @@ if [ -d "$KNOWLEDGE_DIR" ]; then
grep -rh 'fact_id:\s*' "$KNOWLEDGE_DIR" \ grep -rh 'fact_id:\s*' "$KNOWLEDGE_DIR" \
--include='*.yaml' \ --include='*.yaml' \
--exclude='entity-attributes.yaml' \ --exclude='entity-attributes.yaml' \
| grep -v '^\s*#' \
| sed 's/.*fact_id:\s*//' \ | sed 's/.*fact_id:\s*//' \
| sed 's/\s*#.*//' \ | sed 's/\s*#.*//' \
| sed "s/^[\"']\(.*\)[\"']$/\1/" \ | sed "s/^[\"']\(.*\)[\"']$/\1/" \
| sed 's/[[:space:]]*$//' \
| sort -u \ | sort -u \
|| true || true
) )
@@ -39,9 +41,11 @@ if [ -d "$CONTENT_DIR" ]; then
REFERENCED=$( REFERENCED=$(
grep -rh 'fact_id:\s*' "$CONTENT_DIR" \ grep -rh 'fact_id:\s*' "$CONTENT_DIR" \
--include='*.yaml' \ --include='*.yaml' \
| grep -v '^\s*#' \
| sed 's/.*fact_id:\s*//' \ | sed 's/.*fact_id:\s*//' \
| sed 's/\s*#.*//' \ | sed 's/\s*#.*//' \
| sed "s/^[\"']\(.*\)[\"']$/\1/" \ | sed "s/^[\"']\(.*\)[\"']$/\1/" \
| sed 's/[[:space:]]*$//' \
|| true || true
) )
fi fi