-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathlint-python.sh
More file actions
executable file
·50 lines (41 loc) · 967 Bytes
/
Copy pathlint-python.sh
File metadata and controls
executable file
·50 lines (41 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -euo pipefail
# Get the directory where the script is located
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -x "$SCRIPT_DIR/.venv/bin/python" ]; then
PYTHON_BIN="$SCRIPT_DIR/.venv/bin/python"
else
PYTHON_BIN="python3"
fi
if command -v ruff >/dev/null 2>&1; then
RUFF_CMD=(ruff)
else
RUFF_CMD=("$PYTHON_BIN" -m ruff)
fi
if command -v black >/dev/null 2>&1; then
BLACK_CMD=(black)
else
BLACK_CMD=("$PYTHON_BIN" -m black)
fi
SERVICES=(
"backtester"
"broker-service"
"database-accessor-api"
"indicator-api"
"ingestion-service"
"webserver"
)
echo "🔍 Running Ruff checks..."
cd "$SCRIPT_DIR"
for service in "${SERVICES[@]}"; do
echo " - $service"
"${RUFF_CMD[@]}" check "$service"
done
echo ""
echo "🔍 Running Black checks..."
for service in "${SERVICES[@]}"; do
echo " - $service"
"${BLACK_CMD[@]}" --check "$service"
done
echo ""
echo "✅ Python linting and formatting checks complete!"