From bc2c5869f6513470624fc0384d5197a45d6e98bb Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 12 Jun 2026 05:03:44 +0000 Subject: [PATCH] feat(translation): ruff match/union hygiene rules (E721, SIM101, FURB168) for the tagged-unions-plus-match tenet --- litellm/translation/ruff.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/litellm/translation/ruff.toml b/litellm/translation/ruff.toml index f2789f2f42..b63ba2bc74 100644 --- a/litellm/translation/ruff.toml +++ b/litellm/translation/ruff.toml @@ -4,6 +4,12 @@ # module-global rebinding (PLW0603). Inherits the repo config; ruff's # hierarchical discovery applies this file to this subtree automatically, # so the repo-wide `ruff check` enforces it with no extra wiring. +# +# Match/union hygiene (tenet: tagged unions + match over branching on +# types): ruff 0.15 has no use-match-over-isinstance rule, so exhaustiveness +# stays with pyright (reportMatchNotExhaustive + assert_never). What IS +# deterministic here: E721 (no `type(x) ==` branching), SIM101 (no +# duplicated isinstance chains), FURB168 (no isinstance None checks). extend = "../../ruff.toml" preview = true @@ -15,6 +21,9 @@ extend-select = [ "PLR0915", "ANN", "PLW0603", + "E721", + "SIM101", + "FURB168", ] [lint.mccabe]