ui: Update code formatting command in pre-commit hook (#24685)
This commit is contained in:
@@ -27,7 +27,7 @@ echo "Running pre-commit checks for llama-ui..."
|
|||||||
# Format only staged files
|
# Format only staged files
|
||||||
staged_ui=$(git diff --cached --name-only -- tools/ui/)
|
staged_ui=$(git diff --cached --name-only -- tools/ui/)
|
||||||
if [ -n "$staged_ui" ]; then
|
if [ -n "$staged_ui" ]; then
|
||||||
echo "$staged_ui" | xargs npx --no-install prettier --write
|
echo "$staged_ui" | xargs npm run format
|
||||||
format_ok=$?
|
format_ok=$?
|
||||||
# Re-stage formatted files
|
# Re-stage formatted files
|
||||||
git add tools/ui/
|
git add tools/ui/
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ if [ $lint_ok -ne 0 ]; then
|
|||||||
echo "❌ Lint failed"
|
echo "❌ Lint failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $test_ok -ne 0 ]; then
|
if [ $test_ok -ne 0 ]; then
|
||||||
echo "❌ Tests failed"
|
echo "❌ Tests failed"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user