From 2fbb7fe00e49c43aed1c63a00eaf85a5c5567a1e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Mon, 20 Jul 2026 12:15:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20=E4=BF=AE=E5=A4=8D=E5=A2=9E=E9=87=8F?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E4=B8=8BRUFF=5FFILES=E7=A9=BA=E6=A0=BC?= =?UTF-8?q?=E6=AE=8B=E7=95=99=E5=AF=BC=E8=87=B4ruff=E5=85=A8=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=89=AB=E6=8F=8F=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/run_validate.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/ci/run_validate.sh b/scripts/ci/run_validate.sh index f39279abe..543f1848f 100755 --- a/scripts/ci/run_validate.sh +++ b/scripts/ci/run_validate.sh @@ -100,7 +100,11 @@ if [ "$SCAN_MODE" = "incremental" ]; then EXISTING_PY_FILES="" for f in $CHANGED_PY_FILES; do if [ -f "$f" ]; then - EXISTING_PY_FILES="$EXISTING_PY_FILES $f" + if [ -z "$EXISTING_PY_FILES" ]; then + EXISTING_PY_FILES="$f" + else + EXISTING_PY_FILES="$EXISTING_PY_FILES $f" + fi fi done CHANGED_PY_FILES="$EXISTING_PY_FILES" @@ -108,7 +112,7 @@ if [ "$SCAN_MODE" = "incremental" ]; then python3 -m compileall -q $CHANGED_PY_FILES python3 -m black --check --fast $CHANGED_PY_FILES python3 -m isort --check-only $CHANGED_PY_FILES - RUFF_FILES=$(echo "$CHANGED_PY_FILES" | tr ' ' '\n' | grep -v '^scripts/' | tr '\n' ' ') + RUFF_FILES=$(echo "$CHANGED_PY_FILES" | tr ' ' '\n' | grep -v '^scripts/' | grep -v '^$' | xargs) if [ -n "$RUFF_FILES" ]; then python3 -m ruff check $RUFF_FILES --statistics else