Skip to content

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

Closed
mateo-berri wants to merge 2 commits into
litellm_internal_stagingfrom
claude/line-length-config-1ax2q7
Closed

mateo-berri wants to merge 2 commits into
litellm_internal_stagingfrom
claude/line-length-config-1ax2q7

Conversation

@mateo-berri

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 (ruff.toml being the single source of truth for the formatter and import sorter), not 88, so agents and contributors stop wrapping new code to the old Black width


Generated by Claude Code

…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
@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

Copy link
Copy Markdown
Contributor Author

Moved to #31927 to follow the internal branch naming convention; same commits, closing this one


Generated by Claude Code

@mateo-berri mateo-berri closed this Jul 2, 2026
@mateo-berri
mateo-berri deleted the claude/line-length-config-1ax2q7 branch July 2, 2026 02:23
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.

1 participant