chore: tighten eslint pipeline
This commit is contained in:
@@ -152,38 +152,44 @@ if [ "$APP_CHANGED" = false ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── 0. TypeScript + Vite build ──────────────────────────────────────────
|
# ── 0. Frontend lint ───────────────────────────────────────────────────
|
||||||
echo ""
|
echo ""
|
||||||
echo "📦 [0/5] TypeScript + Vite build..."
|
echo "🔎 [0/6] Frontend lint..."
|
||||||
|
pnpm lint
|
||||||
|
echo " ✅ Lint OK"
|
||||||
|
|
||||||
|
# ── 1. TypeScript + Vite build ──────────────────────────────────────────
|
||||||
|
echo ""
|
||||||
|
echo "📦 [1/6] TypeScript + Vite build..."
|
||||||
pnpm build
|
pnpm build
|
||||||
echo " ✅ Build OK"
|
echo " ✅ Build OK"
|
||||||
|
|
||||||
# ── 1. Frontend coverage (≥70%) — includes all unit tests ───────────────
|
# ── 2. Frontend coverage (≥70%) — includes all unit tests ───────────────
|
||||||
echo ""
|
echo ""
|
||||||
echo "📊 [1/5] Frontend tests + coverage (≥70%)..."
|
echo "📊 [2/6] Frontend tests + coverage (≥70%)..."
|
||||||
pnpm test:coverage --silent
|
pnpm test:coverage --silent
|
||||||
echo " ✅ Frontend coverage OK"
|
echo " ✅ Frontend coverage OK"
|
||||||
|
|
||||||
# ── 2. Rust lint (clippy + fmt) — fast, run before coverage ─────────────
|
# ── 3. Rust lint (clippy + fmt) — fast, run before coverage ─────────────
|
||||||
echo ""
|
echo ""
|
||||||
if [ "$RUST_CHANGED" = true ]; then
|
if [ "$RUST_CHANGED" = true ]; then
|
||||||
echo "🔧 [2/5] Clippy + rustfmt..."
|
echo "🔧 [3/6] Clippy + rustfmt..."
|
||||||
cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings
|
cargo clippy --manifest-path=src-tauri/Cargo.toml -- -D warnings
|
||||||
cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
|
cargo fmt --manifest-path=src-tauri/Cargo.toml -- --check
|
||||||
echo " ✅ Rust lint OK"
|
echo " ✅ Rust lint OK"
|
||||||
else
|
else
|
||||||
echo "⏭️ [2/5] Rust lint — skipped (no src-tauri/ changes)"
|
echo "⏭️ [3/6] Rust lint — skipped (no src-tauri/ changes)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── 3. Rust coverage (≥85% lines) ──────────────────────────────────────
|
# ── 4. Rust coverage (≥85% lines) ──────────────────────────────────────
|
||||||
echo ""
|
echo ""
|
||||||
if [ "$RUST_CHANGED" = true ]; then
|
if [ "$RUST_CHANGED" = true ]; then
|
||||||
LLVM_COV_FLAGS="--no-clean"
|
LLVM_COV_FLAGS="--no-clean"
|
||||||
if [ "${LAPUTA_FULL_COVERAGE:-0}" = "1" ]; then
|
if [ "${LAPUTA_FULL_COVERAGE:-0}" = "1" ]; then
|
||||||
LLVM_COV_FLAGS=""
|
LLVM_COV_FLAGS=""
|
||||||
echo "🦀 [3/5] Rust coverage — FULL (LAPUTA_FULL_COVERAGE=1)..."
|
echo "🦀 [4/6] Rust coverage — FULL (LAPUTA_FULL_COVERAGE=1)..."
|
||||||
else
|
else
|
||||||
echo "🦀 [3/5] Rust coverage (≥85%, incremental)..."
|
echo "🦀 [4/6] Rust coverage (≥85%, incremental)..."
|
||||||
fi
|
fi
|
||||||
# Unset GIT_DIR so git tests create isolated repos without inheriting hook context
|
# Unset GIT_DIR so git tests create isolated repos without inheriting hook context
|
||||||
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
|
unset GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE
|
||||||
@@ -196,24 +202,24 @@ if [ "$RUST_CHANGED" = true ]; then
|
|||||||
-- --test-threads=1
|
-- --test-threads=1
|
||||||
echo " ✅ Rust coverage OK"
|
echo " ✅ Rust coverage OK"
|
||||||
else
|
else
|
||||||
echo "⏭️ [3/5] Rust coverage — skipped (no src-tauri/ changes)"
|
echo "⏭️ [4/6] Rust coverage — skipped (no src-tauri/ changes)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── 4. Playwright core smoke lane (if any exist) ──────────────────────
|
# ── 5. Playwright core smoke lane (if any exist) ──────────────────────
|
||||||
echo ""
|
echo ""
|
||||||
SMOKE_FILES=$(find tests/smoke tests/integration -name '*.spec.ts' 2>/dev/null | head -1)
|
SMOKE_FILES=$(find tests/smoke tests/integration -name '*.spec.ts' 2>/dev/null | head -1)
|
||||||
if [ -n "$SMOKE_FILES" ]; then
|
if [ -n "$SMOKE_FILES" ]; then
|
||||||
echo "🎭 [4/5] Playwright core smoke tests..."
|
echo "🎭 [5/6] Playwright core smoke tests..."
|
||||||
if ! pnpm playwright:smoke; then
|
if ! pnpm playwright:smoke; then
|
||||||
echo " ❌ Core smoke tests FAILED"
|
echo " ❌ Core smoke tests FAILED"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo " ✅ Core smoke tests OK"
|
echo " ✅ Core smoke tests OK"
|
||||||
else
|
else
|
||||||
echo "⏭️ [4/5] Playwright core smoke tests — skipped (no tests/**/*.spec.ts)"
|
echo "⏭️ [5/6] Playwright core smoke tests — skipped (no tests/**/*.spec.ts)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ── 5. CodeScene code health gate (ratchet) ──────────────────────────────
|
# ── 6. CodeScene code health gate (ratchet) ──────────────────────────────
|
||||||
# Thresholds live in .codescene-thresholds and only ever go UP (ratchet).
|
# Thresholds live in .codescene-thresholds and only ever go UP (ratchet).
|
||||||
# If remote scores improved, the hook updates the file and stops so the new
|
# If remote scores improved, the hook updates the file and stops so the new
|
||||||
# floor is committed with normal verified hooks before the next push.
|
# floor is committed with normal verified hooks before the next push.
|
||||||
@@ -229,7 +235,7 @@ if [ -f "$THRESHOLDS_FILE" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "🏥 [5/5] CodeScene code health (Hotspot ≥${HOTSPOT_MIN} + Average ≥${AVERAGE_MIN})..."
|
echo "🏥 [6/6] CodeScene code health (Hotspot ≥${HOTSPOT_MIN} + Average ≥${AVERAGE_MIN})..."
|
||||||
if [ -z "$CODESCENE_PAT" ] || [ -z "$CODESCENE_PROJECT_ID" ]; then
|
if [ -z "$CODESCENE_PAT" ] || [ -z "$CODESCENE_PROJECT_ID" ]; then
|
||||||
echo " ⚠️ CODESCENE_PAT or CODESCENE_PROJECT_ID not set — skipping"
|
echo " ⚠️ CODESCENE_PAT or CODESCENE_PROJECT_ID not set — skipping"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"docs:dev": "vitepress dev site --host 127.0.0.1",
|
"docs:dev": "vitepress dev site --host 127.0.0.1",
|
||||||
"docs:build": "pnpm agent-docs && vitepress build site",
|
"docs:build": "pnpm agent-docs && vitepress build site",
|
||||||
"docs:preview": "vitepress preview site --host 127.0.0.1",
|
"docs:preview": "vitepress preview site --host 127.0.0.1",
|
||||||
"lint": "eslint .",
|
"lint": "eslint . --max-warnings=0",
|
||||||
"l10n:translate": "lara-cli translate",
|
"l10n:translate": "lara-cli translate",
|
||||||
"l10n:translate:force": "lara-cli translate --force",
|
"l10n:translate:force": "lara-cli translate --force",
|
||||||
"l10n:validate": "node scripts/validate-locales.mjs",
|
"l10n:validate": "node scripts/validate-locales.mjs",
|
||||||
|
|||||||
Reference in New Issue
Block a user