Files
ednotif-bundle/pre-commit
tristan 7e0c084ebe
All checks were successful
Auto Tag Develop / tag (push) Successful in 5s
Build Release Artefact / build (push) Successful in 36s
feat : restructuration des dossiers pour implementer plus facilement la suite des WS
2026-01-23 16:19:50 +01:00

29 lines
810 B
Bash

#!/bin/sh
echo "######### Pre-commit hook start #############"
echo "--- php-cs-fixer pre commit hook start ---"
FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '\.php$')
# Vérifier s'il y a des fichiers PHP modifiés
if [ -n "$FILES" ]; then
echo "Running PHP CS Fixer on staged PHP files..."
# Convertir la liste des fichiers en une chaîne séparée par des espaces
FILES_LIST=""
for FILE in $FILES; do
FILES_LIST="$FILES_LIST $FILE"
done
# Exécuter la cible make pour PHP CS Fixer
make php-cs-fixer-allow-risky FILES="$FILES_LIST"
# Ajouter les fichiers corrigés au commit
git add $FILES
else
echo "No PHP files to fix."
fi
echo "--- php-cs-fixer pre commit hook finish---"
echo "All checks passed. Proceeding with commit."
exit 0