Skip to content

chore(lint): remove dead E501 config, fix stale blame-ignore SHAs, note 120 line width - #31927

Merged
mateo-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_lint-config-cleanup
Jul 2, 2026
Merged

mateo-berri merged 3 commits into
litellm_internal_stagingfrom
litellm_lint-config-cleanup

Conversation

@mateo-berri

@mateo-berri mateo-berri commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Relevant issues

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

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

Config-only change, so the proof is that each removed piece was demonstrably dead and lint still passes after

E501 was inert before this PR. A 130-char line passes ruff check under the old config while a rule that is genuinely enabled (T201) fires, showing the config loads fine and E501 specifically is suppressed by lint.ignore:

$ printf 'print("hi")\nx = "%s"\n' "$(python3 -c "print('a'*130)")" | uv run ruff check --no-cache --config ../ruff.toml --stdin-filename litellm/fake_probe.py -
T201 `print` found
 --> litellm/fake_probe.py:1:1
Found 1 error.

After the removal, the full lint run is still clean:

$ cd litellm && uv run --no-sync ruff check .
All checks passed!

For the blame-ignore fix, the listed SHAs were the PR-head commits of #31317 and #31518, which never landed on this branch because both PRs were squash merged; the commits actually in history are the squash SHAs this PR swaps in (verifiable in the GitHub UI: the old SHAs 430b5b8 and 3dfbeab are not reachable from litellm_internal_staging, while 17bfd41 and 48b5a5a are the commits on the branch)

Type

🧹 Refactoring

Changes

Three small pieces of lint-config housekeeping surfaced while auditing the line-length setup

ruff.toml had E501 in both lint.ignore and lint.extend-select. Ignore wins, so no maximum line length has actually been linted since E501 was added to the ignore list back in Oct 2024; the formatter's wrap width (line-length = 120) is the only real control. This PR removes E501 from both lists so the config stops implying an enforcement that does not exist, and updates the Makefile comment that mentioned E501 accordingly. No # noqa: E501 directives exist in linted paths, so nothing is orphaned

.git-blame-ignore-revs listed the pre-squash PR-head SHAs for the two ruff reformat commits (#31317 and #31518). Since both PRs were squash merged, those SHAs are not ancestors of the branch and git blame (and the GitHub blame UI) ignored nothing for the two largest formatting commits in the repo. They are replaced with the squash-merge SHAs that are actually in history. The prettier entry for #29622 was checked and already points at the real squash commit

CLAUDE.md now states that the Python line length is 120, not 88, so agents and contributors stop wrapping new code to the old Black width

Replaces #31926 (same commits, moved off a claude/ prefixed branch to follow the internal branch naming convention)

…te 120 width in CLAUDE.md

E501 sat in both lint.ignore and lint.extend-select in ruff.toml; ignore wins,
so no line length was linted at all (verified: a 130-char line passes ruff
check while T201 fires). Remove it from both lists so the config tells the
truth: the formatter's wrap width is the only line-length control, matching
how the repo has actually behaved since E501 was ignored in Oct 2024

.git-blame-ignore-revs listed the pre-squash PR-head SHAs for the two ruff
reformat commits (#31317, #31518), which never landed on the branch, so git
blame ignored nothing. Replace them with the squash-merge SHAs that are
actually in history

Also document in CLAUDE.md that the line length is 120 (ruff.toml), not 88,
so agents stop wrapping to the old Black width
@mateo-berri
mateo-berri marked this pull request as ready for review July 2, 2026 01:33
@mateo-berri mateo-berri changed the title chore(lint): remove dead E501 config, fix stale blame-ignore SHAs, note 120 width in CLAUDE.md chore(lint): remove dead E501 config, fix stale blame-ignore SHAs, note 120 line width Jul 2, 2026
@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Pure lint-config housekeeping with no functional code changes. The E501 removal from ruff.toml is a correctness cleanup — E501 was simultaneously in lint.ignore and lint.extend-select, where ignore always wins, so line-length was never actually enforced by the rule; the formatter's line-length = 120 remains the sole control.

  • ruff.toml: E501 dropped from both lint.ignore and lint.extend-select; net linting behavior is identical to before.
  • .git-blame-ignore-revs: Two SHA entries replaced with the real squash-merge commits so git blame correctly elides the large ruff-reformat noise.
  • CLAUDE.md / Makefile: Minor doc/comment updates to reflect that 120, not 88, is the operative line length.

Confidence Score: 5/5

Safe to merge — all four files are config/documentation only, no production code is touched.

Every change is config or documentation: the ruff.toml edit removes a self-cancelling E501 entry that had zero effect on enforcement, the .git-blame-ignore-revs SHAs are verified against branch history, and the CLAUDE.md and Makefile edits are accurate prose updates. Nothing here can cause a runtime regression.

No files require special attention.

Important Files Changed

Filename Overview
ruff.toml Removes E501 from both lint.ignore and lint.extend-select; since ignore wins over extend-select, E501 was already unenforced — net linting behavior is unchanged
.git-blame-ignore-revs Replaces two pre-squash PR-head SHAs (not in branch history) with the actual squash-merge SHAs so git blame correctly skips the large formatting commits
CLAUDE.md Adds one-line note that Python line length is 120 (not 88) to steer agents and contributors away from the old Black default
Makefile Trims 'E501' from the comment describing what ruff.toml controls, keeping it accurate after the ruff.toml cleanup

Reviews (1): Last reviewed commit: "fix: make CLAUDE.md more concise" | Re-trigger Greptile

@mateo-berri
mateo-berri enabled auto-merge (squash) July 2, 2026 01:39
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mateo-berri
mateo-berri merged commit bd9db36 into litellm_internal_staging Jul 2, 2026
122 checks passed
@mateo-berri
mateo-berri deleted the litellm_lint-config-cleanup branch July 2, 2026 01:44
Rodrigo-Palma pushed a commit to Rodrigo-Palma/litellm that referenced this pull request Jul 3, 2026
…te 120 line width (BerriAI#31927)

* chore(lint): remove dead E501 config, fix stale blame-ignore SHAs, note 120 width in CLAUDE.md

E501 sat in both lint.ignore and lint.extend-select in ruff.toml; ignore wins,
so no line length was linted at all (verified: a 130-char line passes ruff
check while T201 fires). Remove it from both lists so the config tells the
truth: the formatter's wrap width is the only line-length control, matching
how the repo has actually behaved since E501 was ignored in Oct 2024

.git-blame-ignore-revs listed the pre-squash PR-head SHAs for the two ruff
reformat commits (BerriAI#31317, BerriAI#31518), which never landed on the branch, so git
blame ignored nothing. Replace them with the squash-merge SHAs that are
actually in history

Also document in CLAUDE.md that the line length is 120 (ruff.toml), not 88,
so agents stop wrapping to the old Black width

* fix: make CLAUDE.md more concise

* fix: make the guideline more clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants