mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
ruff.toml excludes tests/* from `ruff check`, so nothing has ever checked the test tree for names that do not exist. That matters more in tests than in product code: a NameError inside a test whose body is wrapped in `except Exception: pass` is swallowed, and the test reports green forever. Adds ruff-tests.toml selecting F821 alone, wired into the lint workflow and `make lint-ruff`, and clears every existing violation: - 4 tests interpolated an unbound `e` into a `pytest.fail` message reached only on the failure path, so the NameError, not the assertion, is what ran. test_llm_guard_error_raising is the worst: it passes today with content safety disabled entirely. It now asserts the 400 and its detail body. - 5 sites construct BaseExceptionGroup, a 3.11 builtin, in a tree that still supports 3.10. Guarded behind the exceptiongroup backport that anyio already pulls in below 3.11. - 9 missing imports (json, openai, Any, Final, HTTPException), including one in a helper that catches HTTPException by a name it never imported, so the challenge path it exists to detect raises NameError instead. - 5 annotations naming types imported inside the function body, hoisted to module scope or TYPE_CHECKING. - 2 blocks of dead code: everything after a pytest.fail in test_claude_agent_sdk, and an unused helper in test_end_users calling a function defined in a different module. - 1 error-path f-string in the router-settings doc test that masked the real FileNotFoundError behind a NameError. Only F821 for now. Widening the select list means ratcheting thousands of pre-existing findings, so rules go in one at a time with their violations already fixed. |
||
|---|---|---|
| .. | ||
| _test-unit-base.yml | ||
| auto_update_price_and_context_window.yml | ||
| check-schema-sync.yml | ||
| check-ui-api-types.yml | ||
| check_duplicate_issues.yml | ||
| ci-coverage.yml | ||
| close_low_quality_prs.yml | ||
| codeql.yml | ||
| codspeed.yml | ||
| conventional-commits.yml | ||
| create-release-branch.yml | ||
| create-release.yml | ||
| create_daily_oss_agent_shin_branch.yml | ||
| create_daily_staging_branch.yml | ||
| guard-fork-dependencies.yml | ||
| guard-main-branch.yml | ||
| helm_unit_test.yml | ||
| image-scan.yml | ||
| issue-keyword-labeler.yml | ||
| label-component.yml | ||
| mutation-test.yml | ||
| osv-scan.yml | ||
| publish-basedpyright-base-counts.yml | ||
| scorecard.yml | ||
| stale.yml | ||
| sync-schema.yml | ||
| test-code-quality.yml | ||
| test-linting.yml | ||
| test-litellm-ui-build.yml | ||
| test-litellm-ui-lint.yml | ||
| test-litellm-ui-unit.yml | ||
| test-mcp.yml | ||
| test-model-map.yaml | ||
| test-rust.yml | ||
| test-semgrep.yml | ||
| test-terraform-modules.yml | ||
| test-terraform-provider.yml | ||
| test-unit-documentation.yml | ||
| test-unit-proxy-db.yml | ||
| test-unit.yml | ||
| triage_issue_with_llm.yml | ||
| triage_reconsider.yml | ||
| weekly_load_anomaly.yml | ||
| zizmor.yml | ||