Replace RootModel wrappers with type aliases and TypeAdapter validation (#3470)
Some checks failed
CI / checks (push) Has been cancelled
CI / all-green (push) Has been cancelled

This commit is contained in:
Marcelo Trylesinski 2026-09-07 17:40:21 +02:00 • committed by GitHub
commit 9972c21aa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -219,6 +219,7 @@ ignore = ["PERF203"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"pydantic.RootModel".msg = "Use `pydantic.TypeAdapter` instead."
"pydantic.root_model.RootModel".msg = "Use `pydantic.TypeAdapter` instead."
[tool.ruff.lint.mccabe]
@ -228,8 +229,8 @@ max-complexity = 24 # Default is 10
"__init__.py" = ["F401"]
# The mcp.types package is an alias that mirrors mcp_types namespaces by design.
"src/mcp/types/*.py" = ["F403"]
# Generated by scripts/gen_surface_types.py: raw datamodel-codegen output (TID251 lifts the repo-wide RootModel ban for these generated validators).
"src/mcp-types/mcp_types/_v*/__init__.py" = ["D212", "E501", "I001", "TID251", "UP007", "UP037"]
# Generated by scripts/gen_surface_types.py.
"src/mcp-types/mcp_types/_v*/__init__.py" = ["D212", "E501", "I001", "UP007", "UP037"]
"tests/server/mcpserver/test_func_metadata.py" = ["E501"]
# Inline snapshots of the translation tool's output carry long status/prompt lines verbatim.
"tests/docs/test_translations.py" = ["E501"]