platform-codebase/scripts/reports/lint

50 lines
1.5 KiB
Text
Raw Permalink Normal View History

#!/bin/bash
# Check all feature linting
set -euo pipefail
REPORT_DIR="$(dirname "$0")/../../.reports/lint"
mkdir -p "$REPORT_DIR"
rm -f "$REPORT_DIR"/*.log
echo "=== CHECKING ALL BACKEND LINTING ==="
for feature in features/*/backend-api; do
if [ -f "$feature/package.json" ]; then
feature_name=$(basename $(dirname "$feature"))
echo -n "Testing $feature_name backend... "
if pnpm --filter "./$feature" run lint > "$REPORT_DIR/$feature_name-backend.log" 2>&1; then
echo "✓ PASS"
rm "$REPORT_DIR/$feature_name-backend.log"
else
echo "✗ FAIL (see .reports/lint/$feature_name-backend.log)"
fi
fi
done
echo ""
echo "=== CHECKING ALL FRONTEND LINTING ==="
for feature in features/*/frontend-*; do
if [ -f "$feature/package.json" ]; then
feature_name=$(basename $(dirname "$feature"))
component_name=$(basename "$feature")
echo -n "Testing $feature_name/$component_name... "
if pnpm --filter "./$feature" run lint > "$REPORT_DIR/$feature_name-$component_name.log" 2>&1; then
echo "✓ PASS"
rm "$REPORT_DIR/$feature_name-$component_name.log"
else
echo "✗ FAIL (see .reports/lint/$feature_name-$component_name.log)"
fi
fi
done
echo ""
echo "=== SUMMARY ==="
failed_count=$(ls "$REPORT_DIR"/*.log 2>/dev/null | wc -l)
if [ "$failed_count" -eq 0 ]; then
echo "All linting passed! ✓"
exit 0
else
echo "$failed_count lint check(s) failed. Logs in .reports/lint/"
ls "$REPORT_DIR"/*.log | sed 's|.*/||; s|\.log$||' | sed 's/^/ - /'
exit 1
fi