The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(lint): make strict-gate noqas survive base ruff and flag stale ones
mateo-berri557d14cc71f7
diff --git a/litellm/utils.py b/litellm/utils.pyindex cdf1cc3cf23..911de83b785 100644--- a/litellm/utils.py+++ b/litellm/utils.py@@ -5769,7 +5769,7 @@ def json_schema_type(python_type_name: str):return python_to_json_schema_types.get(python_type_name, "string")-def function_to_dict(input_function) -> dict: # noqa: C901+def function_to_dict(input_function) -> dict:"""Using type hints and numpy-styled docstring,produce a dictionary usable for OpenAI function callingdiff --git a/ruff-strict-budget.json b/ruff-strict-budget.jsonindex 8ff4bfb36c0..a8af4eabb3f 100644--- a/ruff-strict-budget.json+++ b/ruff-strict-budget.json@@ -252,7 +252,7 @@"limit": 67},"RUF100": {- "limit": 100+ "limit": 0},"S110": {"limit": 218diff --git a/ruff-strict.toml b/ruff-strict.tomlindex 01faf04805f..d20fb2e4d7d 100644--- a/ruff-strict.toml+++ b/ruff-strict.toml@@ -4,6 +4,14 @@ extend = "ruff.toml"preview = trueselect = ["ANN", "ASYNC230", "B004", "B006", "B008", "B009", "B010", "B018", "B019", "B021", "B026", "B033", "BLE", "C401", "C404", "C405", "C408", "C414", "C419", "C901", "D419", "DTZ001", "DTZ003", "DTZ005", "DTZ006", "DTZ007", "DTZ011", "EXE001", "EXE002", "F401", "FURB136", "FURB168", "FURB188", "I001", "LOG015", "N999", "PERF102", "PERF401", "PERF402", "PERF403", "PIE790", "PIE800", "PIE804", "PIE810", "PLC0206", "PLC0208", "PLC0414", "PLR0124", "PLR0206", "PLR0402", "PLR1704", "PLR1711", "PLR1714", "PLR1730", "PLR2044", "PLW0127", "PLW0133", "PLW0602", "PLW0603", "PLW1508", "PLW1510", "PYI030", "PYI036", "PYI041", "PYI064", "RET501", "RET504", "RUF010", "RUF012", "RUF015", "RUF019", "RUF022", "RUF023", "RUF046", "RUF051", "RUF059", "RUF100", "S110", "S112", "SIM101", "SIM102", "SIM103", "SIM113", "SIM114", "SIM115", "SIM117", "SIM118", "SIM201", "SIM210", "SIM211", "SIM222", "SIM401", "TC004", "TC005", "TID251", "TRY002", "TRY004", "TRY201", "TRY203", "TRY300", "UP006", "UP007", "UP008", "UP012", "UP018", "UP024", "UP028", "UP031", "UP032", "UP034", "UP035", "UP036", "UP037", "UP045"]extend-select = []+# Overrides the inherited list: rules this gate enforces itself must NOT be external here,+# so this config's RUF100 flags their stale `# noqa` directives. What remains external is+# only what other tooling enforces: upstream litellm's ruff config, plus the base ruff.toml+# rules (T20, E7xx/F5xx/F8xx) this select list doesn't re-enable.+external = [+ "T20", "E731", "F541", "F841",+ "PLC0415", "E402", "BLE001", "ARG002", "S102", "S324", "S606", "D401", "F403", "F405",+][lint.mccabe]max-complexity = 15diff --git a/ruff.toml b/ruff.tomlindex 095e3e24c52..00743e0f38a 100644--- a/ruff.toml+++ b/ruff.toml@@ -6,7 +6,9 @@ lint.extend-select = ["T20", "PGH004", "RUF008", "RUF009", "RUF100"]# litellm's own ruff config both rely on suppressions this config can't see.lint.external = [# Enforced by the strict-rule gate (scripts/ruff_strict_gate.py + ruff-strict.toml)- "C901", "TID251",+ "ANN", "ASYNC230", "B", "C", "D419", "DTZ", "EXE", "FURB", "I001", "LOG015", "N999", "PERF",+ "PIE", "PL", "PYI", "RET", "RUF010", "RUF012", "RUF015", "RUF019", "RUF022", "RUF023",+ "RUF046", "RUF051", "RUF059", "S110", "S112", "SIM", "TC", "TID251", "TRY", "UP",# Enforced by upstream litellm's ruff config, but not run in this repo's CI"PLC0415", "E402", "BLE001", "ARG002", "S102", "S324", "S606", "D401", "F403", "F405",]