diff --git a/scripts/hooks/lint-node.sh b/scripts/hooks/lint-node.sh index 9690de38..13c73682 100755 --- a/scripts/hooks/lint-node.sh +++ b/scripts/hooks/lint-node.sh @@ -1,13 +1,22 @@ #!/bin/bash # Lint Node/TypeScript code with ESLint and Prettier -set -e - REPO_ROOT="$(git rev-parse --show-toplevel)" cd "$REPO_ROOT/hindsight-control-plane" echo " Linting Node/TS with ESLint and Prettier..." -npx eslint --fix "src/**/*.{ts,tsx}" -npx prettier --write "src/**/*.{ts,tsx}" + +# Capture output and only show on failure +OUTPUT=$(npx eslint --fix "src/**/*.{ts,tsx}" 2>&1) +if [ $? -ne 0 ]; then + echo "$OUTPUT" + exit 1 +fi + +OUTPUT=$(npx prettier --write "src/**/*.{ts,tsx}" 2>&1) +if [ $? -ne 0 ]; then + echo "$OUTPUT" + exit 1 +fi echo " Node lint complete" diff --git a/scripts/hooks/lint-python.sh b/scripts/hooks/lint-python.sh index 2e4fd454..b42224ce 100755 --- a/scripts/hooks/lint-python.sh +++ b/scripts/hooks/lint-python.sh @@ -1,13 +1,22 @@ #!/bin/bash # Lint Python code with Ruff -set -e - REPO_ROOT="$(git rev-parse --show-toplevel)" cd "$REPO_ROOT/hindsight-api" echo " Linting Python with Ruff..." -uv run ruff check --fix . -uv run ruff format . + +# Capture output and only show on failure +OUTPUT=$(uv run ruff check --fix . 2>&1) +if [ $? -ne 0 ]; then + echo "$OUTPUT" + exit 1 +fi + +OUTPUT=$(uv run ruff format . 2>&1) +if [ $? -ne 0 ]; then + echo "$OUTPUT" + exit 1 +fi echo " Python lint complete"