fix: add 60% coverage minimum to CI, scope prettier to staged frontend files
This commit is contained in:
@@ -13,13 +13,12 @@ NC='\033[0m' # No Colour
|
||||
|
||||
FAILED=0
|
||||
|
||||
# ---------- Frontend (prettier --write, then eslint) ----------
|
||||
FRONTEND_STAGED=$(git diff --cached --name-only -- 'frontend/' | head -1)
|
||||
if [ -n "$FRONTEND_STAGED" ]; then
|
||||
# ---------- Frontend (prettier --write staged, then eslint) ----------
|
||||
STAGED_FRONTEND=$(git diff --cached --name-only --diff-filter=ACMR | grep '^frontend/' || true)
|
||||
if [ -n "$STAGED_FRONTEND" ]; then
|
||||
printf "${YELLOW}Auto-formatting staged frontend files with prettier...${NC}\n"
|
||||
cd frontend && npx prettier --write . 2>&1
|
||||
echo "$STAGED_FRONTEND" | xargs npx prettier --write 2>/dev/null || true
|
||||
# Re-stage any files prettier modified so formatting is included in the commit
|
||||
cd ..
|
||||
git diff --name-only -- 'frontend/' | xargs -r git add
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user