mirror of
https://github.com/tiennm99/litellm.git
synced 2026-06-17 18:48:36 +00:00
23724c4392
- pyright strict scoped to the folder (litellm/translation/pyrightconfig.json), 0 errors: standardized the exhaustiveness pattern to match-on-Literal-tag with assert_never AFTER the match (a 'case never:' capture arm is flagged by strict as unmatchable), restructured narrowing-hostile spots instead of suppressing - ruff folder config (litellm/translation/ruff.toml): PLR1702 (preview), C901, PLR0915, ANN incl. ANN401, PLW0603 + complexity caps; picked up by the repo-wide ruff run through hierarchical discovery; folder also modernized to PEP-604/builtin generics and black-formatted (CI formatter) - semgrep tenet rules (.semgrep/rules/python/translation/): no raise outside errors.py, no mutation methods/subscript/augmented assignment, no module-level mutable state (the rule that would have caught audit F2); rides the existing semgrep workflow; effort maps frozen behind MappingProxyType and the name-collision loop rewritten without += - import-linter contracts in pyproject (forbidden v1-stack imports + downward- only layers), import-linter==2.3 added to the dev group (uv.lock updated) - CI: code-quality job gains translation_v2_pyright_strict and translation_v2_import_contracts steps; 'make lint-translation' runs all four gates plus the package tests locally in one command - CLAUDE.md rewritten to match the real tree and conventions