#144 Ajout des fichiers commit-msg et pre-commit. Modification de .editorconfig pour ajouter des règles personnalisées. Exclusion de Progam.cs pour l'erreur SA1200.

This commit is contained in:
josephine.vetu
2026-03-31 11:16:34 +02:00
parent c65c0113af
commit 8eaefe7903
21 changed files with 374 additions and 310 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Hook: commit-msg
# Validates the commit message format.
# Git passes the path to the temp message file as $1.
COMMIT_MSG=$(cat "$1")
if [ ${#COMMIT_MSG} -le 10 ]; then
echo "❌ Erreur : Le message doit faire plus de 10 caractères."
exit 1
fi
if ! echo "$COMMIT_MSG" | grep -q "\.$"; then
echo "❌ Erreur : Le commit doit se terminer par un point."
exit 1
fi
if ! echo "$COMMIT_MSG" | grep -q "#[0-9]\+"; then
echo "❌ Erreur : Vous devez faire référence à un ticket (ex: #123)."
exit 1
fi
exit 0