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