Skip to content

Commit

Permalink
chore: update pre-commit hook to stage formatting changes and improve…
Browse files Browse the repository at this point in the history
… messaging
  • Loading branch information
charlottewiltshire0 committed Mar 3, 2025
1 parent 1cac300 commit a0802df
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -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! 🎉"
Expand Down

0 comments on commit a0802df

Please sign in to comment.