From 12d40b2602df4e9dacdd9a02700f1fb1c6e6c117 Mon Sep 17 00:00:00 2001 From: Marijn Doeve Date: Tue, 7 Jul 2026 08:01:57 +0200 Subject: [PATCH] fix: exclude auto-generated reference.php from pre-commit CS-fixer --- .githooks/pre-commit | 4 ++-- config/reference.php | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.githooks/pre-commit b/.githooks/pre-commit index bc6ea31..7e5a4de 100755 --- a/.githooks/pre-commit +++ b/.githooks/pre-commit @@ -4,7 +4,7 @@ setopt ERR_EXIT PIPE_FAIL NOUNSET # Collect staged PHP and Twig files STAGED_PHP=() while IFS= read -r file; do - [[ -n "$file" ]] && STAGED_PHP+=("$file") + [[ -n "$file" && "$file" != "config/reference.php" ]] && STAGED_PHP+=("$file") done < <(git diff --cached --name-only --diff-filter=ACMR | grep -E '\.php$' || true) STAGED_TWIG=() @@ -32,7 +32,7 @@ if [[ ${#STAGED_PHP[@]} -gt 0 ]]; then git add "${STAGED_PHP[@]}" echo " → PHP-CS-Fixer" - "${DOCKER_CMD[@]}" vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php "${STAGED_PHP[@]}" + "${DOCKER_CMD[@]}" vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --path-mode=intersection "${STAGED_PHP[@]}" git add "${STAGED_PHP[@]}" echo " → PHPStan" diff --git a/config/reference.php b/config/reference.php index 27b09bf..dad68a9 100644 --- a/config/reference.php +++ b/config/reference.php @@ -1,7 +1,5 @@