fix(patches): validator portability, clearer docs, broader hook trigger

This commit is contained in:
Patrick Schratz 2026-06-30 09:17:24 +02:00
commit f3f3bfa20d
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -0,0 +1,42 @@
# Task B3: Hook the validator into pre-commit — Report
## Step 1: Added the hook
Added the following block to `.pre-commit-config.yaml` (lines 46-51), appended to the existing `repo: local` section:
```yaml
- id: validate-patches
name: validate patch registry
entry: Rscript local/validate-patches.R
language: system
files: ^local/patches/
pass_filenames: false
```
The hook was integrated alongside the existing `yaml-file-extension` hook, maintaining consistent indentation and YAML structure.
## Step 2: Verified the hook runs
Ran: `pre-commit run validate-patches --all-files`
Output:
```
[INFO] Initializing environment for https://github.com/rbubley/mirrors-prettier.
[INFO] Initializing environment for https://github.com/rbubley/mirrors-prettier:prettier@3.9.1.
[INFO] Initializing environment for https://github.com/posit-dev/air-pre-commit.
[INFO] Initializing environment for https://github.com/editorconfig-checker/editorconfig-checker.
validate patch registry..................................................Passed
```
Hook passed successfully (pre-commit is installed in this environment).
## Step 3: Committed
```
git add .pre-commit-config.yaml && git commit -m "ci(patches): validate patch registry in pre-commit"
```
Commit: `912423f ci(patches): validate patch registry in pre-commit`
---
**Status:** Complete. Hook added, verified, and committed successfully.