mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
chore(lint): remove dead E501 config, fix stale blame-ignore SHAs, note 120 line width (#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 (#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 * fix: make CLAUDE.md more concise * fix: make the guideline more clear
This commit is contained in:
parent
8ce6b4d712
commit
bd9db3691e
4 changed files with 7 additions and 5 deletions
|
|
@ -13,7 +13,7 @@
|
|||
7edf3a9cb55548b143df1692f4ed7c4681d7fcf7
|
||||
|
||||
# style: reformat litellm/ with ruff format (#31317)
|
||||
430b5b8f1b12dc261a49fda99ac5d1b22381a428
|
||||
17bfd415aeb5a57fb646b5cc67da1c730aa7c50b
|
||||
|
||||
# style: unify ruff format width on 120 (#31518)
|
||||
3dfbeabe626d203ac9de86024519d9a96c484ce4
|
||||
48b5a5a0cc5a694a11219416ee0b6eb6e620e74e
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ If you ever make public-facing PR descriptions, comments, issues, commit message
|
|||
|
||||
Don't hesitate to use values in .env to get needed API keys and other secrets, as long as you never add them to conversation history, commit them, or include them in GitHub issues / PRs
|
||||
|
||||
Python max line length is 120, not 88
|
||||
|
||||
Run tests before you commit. Also, run `make pre-commit` right before each commit, which generates types (as needed) and formats/lints your code. Any errors found must be fixed. It only runs when there are staged frontend and/or backend changes and calculates violations, generates types, etc. based on the worktree, so stage what you need or stash/delete unwanted files in litellm/ or ui/ (where backend and frontend lint run, respectively) before running it. If it fails because dashboard api types are stale, it already regenerated them for you. You just need to stage the schema.d.ts, re-run `make pre-commit` to confirm it passes, and commit
|
||||
|
||||
When you fix violations gated by `ruff-strict-budget.json`, `type-discipline-budget.json`, or `basedpyright-code-budget.json`, run `make lint-budget-update` and commit the lowered limits so the ceilings ratchet down instead of leaving stale headroom. It measures the working tree, so it must contain exactly the fixes you're committing
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -88,7 +88,7 @@ install-hooks:
|
|||
|
||||
# Formatting
|
||||
# Wrap width is ruff.toml's single source of truth (line-length = 120), shared by the
|
||||
# formatter, E501, and the import sorter so there's no 88-vs-120 split to reconcile.
|
||||
# formatter and the import sorter so there's no 88-vs-120 split to reconcile.
|
||||
format: install-dev
|
||||
cd litellm && $(UV_RUN) ruff format --exclude '/enterprise/' . && cd ..
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
lint.ignore = ["F405", "E402", "E501", "F403"]
|
||||
lint.extend-select = ["E501", "T20", "PGH004", "RUF008", "RUF009", "RUF100"]
|
||||
lint.ignore = ["F405", "E402", "F403"]
|
||||
lint.extend-select = ["T20", "PGH004", "RUF008", "RUF009", "RUF100"]
|
||||
# RUF100 (unused-noqa) only knows the rules enabled in THIS config, so it would strip
|
||||
# `# noqa` directives that protect rules enforced elsewhere. List those codes as external
|
||||
# so RUF100 leaves their directives alone: the strict gate (ruff-strict.toml) and upstream
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue