From 0b73fc79fe7c8968b040e9c96d91610d7d2a8206 Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Thu, 18 Jun 2026 08:33:50 +0200 Subject: [PATCH] ui: Update code formatting command in pre-commit hook (#24685) --- tools/ui/scripts/git-hooks/pre-commit.sh | 2 +- tools/ui/scripts/git-hooks/pre-push.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/ui/scripts/git-hooks/pre-commit.sh b/tools/ui/scripts/git-hooks/pre-commit.sh index 1fa83efde5..208ef56fcd 100755 --- a/tools/ui/scripts/git-hooks/pre-commit.sh +++ b/tools/ui/scripts/git-hooks/pre-commit.sh @@ -27,7 +27,7 @@ echo "Running pre-commit checks for llama-ui..." # Format only staged files staged_ui=$(git diff --cached --name-only -- tools/ui/) if [ -n "$staged_ui" ]; then - echo "$staged_ui" | xargs npx --no-install prettier --write + echo "$staged_ui" | xargs npm run format format_ok=$? # Re-stage formatted files git add tools/ui/ diff --git a/tools/ui/scripts/git-hooks/pre-push.sh b/tools/ui/scripts/git-hooks/pre-push.sh index 953d3a2243..66d79b950a 100755 --- a/tools/ui/scripts/git-hooks/pre-push.sh +++ b/tools/ui/scripts/git-hooks/pre-push.sh @@ -57,6 +57,7 @@ if [ $lint_ok -ne 0 ]; then echo "❌ Lint failed" exit 1 fi + if [ $test_ok -ne 0 ]; then echo "❌ Tests failed" exit 1