Skip to content

LLM inference in C/C++

C++ ggml

ui: Update code formatting command in pre-commit hook (#24685)

Aleksander Grygier0b73fc79fe7c
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