From a0802df000937ece771a2dc9388384804bc60a7d Mon Sep 17 00:00:00 2001 From: Charlotte Date: Mon, 3 Mar 2025 20:45:21 +0200 Subject: [PATCH] chore: update pre-commit hook to stage formatting changes and improve messaging --- .husky/pre-commit | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 0bf7849..c326e2a 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -16,10 +16,14 @@ if [ $? -ne 0 ]; then exit 1 fi -# Check if there are any staged changes to commit +# Stage changes made by Prettier +echo "📂 Staging formatting changes..." +git add . + +# Ensure there are staged changes before proceeding if git diff --cached --quiet; then - echo "❌ No changes to commit. Aborting." - exit 1 + echo "❌ No changes to commit." + exit 1 fi echo "✅ All pre-commit checks passed! 🎉"