docs: add pre-commit hook activation instructions to README (closes #54)
All checks were successful
Lint / PHP Syntax Check (push) Successful in 32s
Lint / CSS Lint (stylelint) (push) Successful in 1m10s
Lint / HTML Lint (htmlhint) (push) Successful in 1m7s

This commit is contained in:
Claw (AI)
2026-05-22 13:16:54 +00:00
parent 6b605bb961
commit 4d2393f436

View File

@@ -172,6 +172,20 @@ npm run lint
## Git-Workflow
### Pre-Commit Hooks aktivieren
Die Pre-Commit Hooks (Husky + lint-staged) werden automatisch beim Installieren der Abhängigkeiten eingerichtet:
```bash
npm install
```
Der `prepare`-Script in `package.json` (`"prepare": "husky"`) sorgt dafür, dass Husky die Git Hooks im `.husky/`-Verzeichnis registriert. Nach `npm install` sind die Hooks aktiv kein manueller Schritt nötig.
> **Falls Hooks nicht laufen:** Prüfe ob `.husky/pre-commit` ausführbar ist (`chmod +x .husky/pre-commit`) und ob `core.hooksPath` nicht überschrieben wurde (`git config core.hooksPath`).
### Was wird beim Commit geprüft?
Beim Committen führt **Husky** automatisch den Pre-Commit Hook (`.husky/pre-commit`) aus, der **lint-staged** startet.
### lint-staged prüft automatisch: