ruff
6f2f4862 - [ty] Pydantic: Warn about immediately discarded extra arguments (#26762)

Commit
40 days ago
[ty] Pydantic: Warn about immediately discarded extra arguments (#26762) ## Summary By default, Pydantic allows arbitrary extra constructor arguments, which is simply ignored (`extra="ignore"`). This often indicates a mistake though, so we now emit emit a new diagnostic with severity "warning": ```py class Person(BaseModel): name: str admin: bool = Field(default=false) # a typo: should be `admin`, not `admni` Person(name="Alice", admni=true) # warning: [pydantic-discarded-extra-argument] ``` closes https://github.com/astral-sh/ty/issues/3966 ## Ecosystem impact One true positive. ## Test plan New and updated Markdown tests
Author
Parents
Loading