build(lint): rename make pre-commit to make check with a working-tree fallback - #36277
Merged
mateo-berri merged 2 commits intoAug 8, 2026
Merged
Conversation
Contributor
Greptile SummaryThe PR renames the primary local lint target to
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains; the previously reported deletion-only false green is fixed for staged, unstaged, and committed deletions without passing deleted paths to file-reading tools.
|
| Filename | Overview |
|---|---|
| scripts/pre_commit_lint.sh | Implements staged-or-merge-base scope selection, deletion-aware triggers, existing-file filtering, and partial-staging diagnostics; the previously reported deletion-only false green is resolved. |
| tests/test_litellm/test_pre_commit_lint.py | Adds focused regression tests for unstaged, committed, untracked, deletion-only, no-op, missing-ref, and partial-staging cases. |
| Makefile | Introduces check as the primary target and preserves pre-commit as a delegating compatibility alias. |
| CLAUDE.md | Updates contributor guidance to describe the renamed command and its staged-versus-merge-base scoping behavior. |
Reviews (2): Last reviewed commit: "build(lint): count deleted files toward ..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
Author
tin-berri
approved these changes
Aug 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR
Problem this solves:
make pre-commitwith nothing staged silently checks nothing and exits 0How it solves it:
make check;make pre-commitstays as a legacy aliasUser Flow
Before: a contributor (or coding agent) with edited but unstaged files runs
make pre-commitand gets a green exit that checked nothinglitellm/and, without staging anything, runmake pre-commitAfter: the same run with nothing staged checks the branch's actual diff, and partial staging warns instead of silently skipping
litellm/and, without staging anything, runmake check(typingmake pre-commitstill works and prints that it is a legacy alias)make checkvalidates the merged tree the same way, staging only part of the changes makes the run print which check was SKIPPED and which changed files are not staged, and a branch whose only change deletes files gets its checks run instead of a green "nothing to check"Relevant issues
Linear ticket
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
@greptileaito re-request a review after pushing changes)Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
All legs ran in a fresh bootstrapped worktree. Before legs at base e24a914, after legs at head fb7861f
Before: an unstaged
litellm/constants.pyedit with nothing staged runs zero checks and exits 0After: the same state runs the full Python lint through the fallback and passes
Deletion-only branch, the case Greptile flagged: at the previous head f038be2, deleting
litellm/cost_calculator.pyat the staging tip with nothing staged reported a false greenAfter: the same deletion-only tree triggers the Python lint, which goes red on the import CI would have caught, and the deleted path is never handed to ruff format
After: partial staging (only CLAUDE.md staged,
litellm/constants.pyleft unstaged) via the legacy aliasAfter: a clean tree at the base tip is an explicit no-op
Test suite, 10 pre-existing tests plus 9 new ones:
Type
🚄 Infrastructure
✅ Test
Changes
checktarget replacespre-commit, which becomes an alias that prints a notice and delegatesmake checkand the new scoping rulesFinal Attestation