mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-05 00:45:29 +08:00
feat: introduce new quality gates, Node.js syntax checks, and manual smoke test status validation
This commit is contained in:
38
tests/scripts/check-node-split-syntax.sh
Executable file
38
tests/scripts/check-node-split-syntax.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "$0")/../.." && pwd)"
|
||||
TARGETS_FILE="${1:-$ROOT_DIR/plans/node-syntax-gate-targets.txt}"
|
||||
|
||||
if [[ ! -f "$TARGETS_FILE" ]]; then
|
||||
echo "missing targets file: $TARGETS_FILE" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
checked=0
|
||||
missing=0
|
||||
invalid=0
|
||||
|
||||
while IFS= read -r file; do
|
||||
[[ -z "$file" ]] && continue
|
||||
[[ "${file:0:1}" == "#" ]] && continue
|
||||
|
||||
checked=$((checked + 1))
|
||||
abs="$ROOT_DIR/$file"
|
||||
if [[ ! -f "$abs" ]]; then
|
||||
echo "MISSING $file"
|
||||
missing=$((missing + 1))
|
||||
continue
|
||||
fi
|
||||
|
||||
if ! node --check "$abs"; then
|
||||
echo "INVALID $file"
|
||||
invalid=$((invalid + 1))
|
||||
fi
|
||||
done < "$TARGETS_FILE"
|
||||
|
||||
echo "checked=$checked missing=$missing invalid=$invalid"
|
||||
|
||||
if (( missing > 0 || invalid > 0 )); then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user