less verbose git hooks
This commit is contained in:
parent
9394cf92f2
commit
11ac9cd9a5
2 changed files with 26 additions and 8 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue