22 lines
506 B
Bash
22 lines
506 B
Bash
#!/bin/sh
|
|
|
|
# Hook: pre-commit
|
|
# Runs dotnet format on staged files, then verifies documentation warnings.
|
|
|
|
echo "🔧 Running dotnet format..."
|
|
dotnet format --severity warn
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Erreur : dotnet format a échoué."
|
|
exit 1
|
|
fi
|
|
git add -u
|
|
|
|
echo "📄 Vérification de la documentation..."
|
|
dotnet format style --severity warn --verify-no-changes
|
|
if [ $? -ne 0 ]; then
|
|
echo "❌ Erreur : Documentation manquante (classes/méthodes non commentées)."
|
|
exit 1
|
|
fi
|
|
|
|
exit 0
|