fix(ci): exclude deleted files from ruff format check - #31462
Conversation
git diff --name-only includes deleted paths, so a PR that removes a litellm/**/*.py file feeds the gone path to ruff format --check, which exits 123 with 'No such file or directory'. Add --diff-filter=ACMR so only added/copied/modified/renamed files are checked, matching the pattern already used in test-litellm-ui-build.yml.
Greptile SummaryThis PR fixes a false-positive CI failure in the "Check ruff format" step of the LiteLLM Linting workflow, which would exit with code 123 whenever a PR deleted a
Confidence Score: 5/5Safe to merge — the change is confined to a single CI workflow line and only affects which files are piped to The one-line fix is clearly correct: No files require special attention.
|
| Filename | Overview |
|---|---|
| .github/workflows/test-linting.yml | Adds --diff-filter=ACMR to git diff to exclude deleted files from the ruff format check, fixing a spurious exit-123 failure when a PR removes a Python file. |
Reviews (1): Last reviewed commit: "fix(ci): exclude deleted files from ruff..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
mateo-berri
left a comment
There was a problem hiding this comment.
LGTM; thanks!
Apologies that the new linting caused friction
0932dde
into
litellm_internal_staging
Relevant issues
The "Check ruff format" step in the LiteLLM Linting workflow fails with exit code 123 on any PR that deletes a
litellm/**/*.pyfile. Surfaced on the promote-to-main PR #31384, which removeslitellm/ocr/rust_bridge.py:Type
🐛 Bug Fix
Changes
The step builds its file list with
git diff --name-only, which includes deleted paths. The deleted file is then piped toruff format --check, which cannot format a file that no longer exists on disk and exits 123. Every other file is already correctly formatted; the failure is purely a workflow bug, not a real formatting issue.The fix adds
--diff-filter=ACMRso only added, copied, modified, and renamed files are checked, dropping deletions. This matches the pattern already used intest-litellm-ui-build.ymlScreenshots / Proof of Fix
Local reproduction of the false positive and the fix, against the same base SHA CI used (
bd2a1653bd92aeef272b29feaa750706db094975):Before (current
mainbehavior; lists the deleted file):After (
--diff-filter=ACMR; deleted file is gone):The CI run for this PR exercises the changed workflow directly, since
pull_requestruns the workflow from the merge commit