Commit Graph

4 Commits

Author SHA1 Message Date
Hermes
3f1f0f5788 fix(hooks): use array-based file iteration for safety check
All checks were successful
Deploy Feature Branch to Test / PHP Syntax Check (push) Successful in 58s
Lint / PHP Syntax Check (push) Successful in 1m0s
Deploy Feature Branch to Test / HTML Lint (htmlhint) (push) Successful in 1m39s
Deploy Feature Branch to Test / CSS Lint (stylelint) (push) Successful in 1m42s
Deploy Feature Branch to Test / Deploy to Test Environment (push) Successful in 23s
Lint / HTML Lint (htmlhint) (push) Successful in 1m16s
Lint / CSS Lint (stylelint) (push) Successful in 1m21s
Lint / PHP Syntax Check (pull_request) Successful in 31s
Lint / CSS Lint (stylelint) (pull_request) Successful in 1m13s
Lint / HTML Lint (htmlhint) (pull_request) Successful in 1m4s
mapfile + array prevents word-splitting issues with filenames
containing spaces or other shell-special characters. Affects both
the affected-files listing and the stale-index safety check.

Without this fix, a filename like 'My Module.php' would be split
into 'My' and 'Module.php', causing the disk-existence check to
look for wrong paths.
2026-06-04 00:15:21 +00:00
Hermes
b0f769d186 feat(hooks): run PHPUnit in pre-commit hook (#67)
All checks were successful
Deploy Feature Branch to Test / PHP Syntax Check (push) Successful in 34s
Lint / PHP Syntax Check (push) Successful in 57s
Deploy Feature Branch to Test / CSS Lint (stylelint) (push) Successful in 1m41s
Deploy Feature Branch to Test / HTML Lint (htmlhint) (push) Successful in 1m39s
Lint / CSS Lint (stylelint) (push) Successful in 1m39s
Lint / HTML Lint (htmlhint) (push) Successful in 1m8s
Deploy Feature Branch to Test / Deploy to Test Environment (push) Successful in 30s
Erweitert den Husky pre-commit-Hook um einen PHPUnit-Schritt.
Ausserdem wird scripts/safe-commit.sh aktualisiert, damit das
Safety-Net dieselbe Logik wie der Hook verwendet (kein doppelter Code).

Vorher: Hook rief nur 'npx lint-staged' auf.
Nachher: Hook ruft scripts/pre-commit-checks.sh auf, das
  - lint-staged ausfuehrt (unveraendert)
  - PHPUnit nur dann ausfuehrt, wenn PHP-relevante Dateien
    gestaged sind (Performance-Optimierung: Issue #67 Anforderung)
  - Bei Test-Fehler den Commit mit Exit-Code 1 abbricht

Closes #67
2026-06-03 23:42:31 +00:00
Hermes
85cf4f3b03 chore(hooks): add shared pre-commit-checks script
Extrahiert die Pre-Commit-Checks (lint-staged + PHPUnit) in ein
gemeinsames Script, das sowohl vom Husky-Hook (.husky/pre-commit)
als auch von scripts/safe-commit.sh aufgerufen wird.

Logik:
- lint-staged laeuft immer (HTML/CSS/JS/JSON/MD/PHP-Syntax)
- PHPUnit laeuft nur, wenn PHP-relevante Dateien gestaged sind
  (*.php, phpunit.xml, composer.json, composer.lock)
- Safety-Check: alle gestaged PHP-Dateien muessen auf Disk existieren
- Bei Test-Fehler wird der Commit mit Exit-Code != 0 abgebrochen
- Composer-Deps werden nur bei Bedarf installiert (Cache-Hit)
2026-06-03 23:42:22 +00:00
Claw
fb646eba85 feat: enforce lint checks as gate for commits and CI (#54)
All checks were successful
Deploy Feature Branch to Test / PHP Syntax Check (push) Successful in 34s
Deploy Feature Branch to Test / CSS Lint (stylelint) (push) Successful in 1m12s
Deploy Feature Branch to Test / HTML Lint (htmlhint) (push) Successful in 1m10s
Lint / PHP Syntax Check (push) Successful in 32s
Lint / CSS Lint (stylelint) (push) Successful in 1m14s
Lint / HTML Lint (htmlhint) (push) Successful in 1m9s
Lint / PHP Syntax Check (pull_request) Successful in 32s
Lint / CSS Lint (stylelint) (pull_request) Successful in 1m11s
Lint / HTML Lint (htmlhint) (pull_request) Successful in 1m9s
Deploy Feature Branch to Test / Deploy to Test Environment (push) Successful in 24s
- Add PHP syntax check to lint-staged via scripts/lint-php.sh
- Add lint:php script to package.json
- Update lint script to include PHP checks
- Create scripts/safe-commit.sh for AI agent use
- Update deploy-test.yml: lint jobs as gate before deploy
- Add branch protection for main requiring status checks
- Update AGENTS.md with pre-commit hook rules for agents

Also addresses #53: CI requires lint checks before merge

Co-authored-by: Claw <claw@openclaw.local>
2026-05-22 07:25:57 +00:00