ci: scope ruff format check to changed files

This commit is contained in:
Ishaan Jaff 2026-06-25 12:11:36 -07:00
parent fa0e710433
commit 1bfa6256ec
No known key found for this signature in database

View file

@ -51,10 +51,15 @@ jobs:
uv sync --frozen
- name: Check ruff format
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
run: |
cd litellm
uv run --no-sync ruff format --check --line-length 88 --exclude '/enterprise/' .
cd ..
git diff --name-only "$BASE_SHA"...HEAD -- 'litellm/**/*.py' | grep -v '^litellm/enterprise/' > "$RUNNER_TEMP/ruff_format_files.txt" || true
if [ ! -s "$RUNNER_TEMP/ruff_format_files.txt" ]; then
echo "No changed litellm Python files to check with ruff format."
exit 0
fi
xargs uv run --no-sync ruff format --check --line-length 88 --exclude '/enterprise/' < "$RUNNER_TEMP/ruff_format_files.txt"
- name: Debug - Check file state
run: |