feat(gate): check.sh --brief prints a red lane's first error lines only

This commit is contained in:
2026-10-04 20:09:58 +02:00
parent bc856ab2af
commit 27f48b7a8b
2 changed files with 64 additions and 9 deletions
+30 -5
View File
@@ -1436,7 +1436,8 @@
"e2e/helpers.ts",
"e2e/nav.spec.ts",
"e2e/player.spec.ts",
"e2e/settings.spec.ts"
"e2e/settings.spec.ts",
"e2e/speed.measure.ts"
],
"js configs": ["eslint.config.js", "postcss.config.js"],
"lib tests": [
@@ -2309,16 +2310,40 @@
"scripts/check.sh": [
"set -u",
"cd \"$(dirname \"$0\")/..\" || exit 2",
"mode=\"${1:-all}\"",
"case \"$mode\" in all | lint) ;; *) echo \"usage: scripts/check.sh [lint]\" >&2; exit 2 ;; esac",
"mode=all",
"brief=0",
"for arg in \"$@\"; do",
" case \"$arg\" in",
" all | lint) mode=\"$arg\" ;;",
" --brief) brief=1 ;;",
" esac",
"done",
"export MSYS_NO_PATHCONV=1 # Git Bash: do not rewrite the in-container paths below",
"TESTCOMPOSE=backend/docker-compose.test.yml",
"failed=()",
"lane() { # lane <name> <command…> — run it, remember a failure, never stop",
" local name=\"$1\"",
" shift",
" echo \">> $name…\"",
" \"$@\" || failed+=(\"$name\")",
" if [ \"$brief\" = 0 ]; then",
" echo \">> $name…\"",
" \"$@\" || failed+=(\"$name\")",
" return 0",
" fi",
" local out",
" out=\"$(mktemp)\"",
" if \"$@\" >\"$out\" 2>&1; then",
" echo \">> $name: ok\"",
" else",
" failed+=(\"$name\")",
" echo \">> $name: FAILED\"",
" brief_excerpt \"$out\"",
" fi",
" rm -f \"$out\"",
"}",
"brief_excerpt() {",
" local hits",
" hits=\"$(grep -E -i -A 2 -m 20 'error|fail|✗|×|warn|would reformat|unused|vulnerab|found [0-9]' \"$1\")\"",
" if [ -n \"$hits\" ]; then printf '%s\\n' \"$hits\"; else tail -n 20 \"$1\"; fi",
"}",
"ruff_pinned() {",
" local pin host",