Skip to content

Codecheck gives false postive error of extra fields not permitted #1103

@peter9711

Description

@peter9711

Describe the bug
Codecheck gives false postive error of extra fields not permitted (maybe when field name starts with model_?)

To Reproduce

from pydantic import BaseModel, ConfigDict


class Cls(BaseModel):
    model_config = ConfigDict(extra="forbid")

    model_233: str

a=Cls(model_233="bert")
print(a)

Codecheck gives the following error:
'model_233' extra fields not permitted

Expected behavior
No errors in codecheck.

Environments (please complete the following information):

  • IDE: PyCharm 2025.2.0.1 Build #PY-252.23892.515, built on August 12, 2025
  • OS: Windows 11 Pro 24H2
  • Pydantic Version 2.11.7
  • Plugin version 0.4.19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions