Repository: Viicos/flake8-pydantic

Issue:
Using `ConfigDict` or `SettingsConfigDict` requires an annotation
When I use other config classes, such as `ConfigDict`, I get flake8 errors with this plugin.
Attempting to annotate those classes leads to mypy complaining about overrides from base model to submodels, and the pydantic documentation doesn't show extra annotation here.

For example, if I have

```python
    model_config = ConfigDict(arbitrary_types_allowed=True)
```

flake8 errors with

```
    PYD002 Non-annotated attribute inside Pydantic model
```

Changing it to 

```python
    model_config: ConfigDict = ConfigDict(arbitrary_types_allowed=True)
```

is not ideal for a few reasons stated above!

Hints from issue comments:
@Viicos: Sorry for the delay, fixed in https://github.com/Viicos/flake8-pydantic/pull/16 and in the next published version.

Solution patch:
diff --git a/src/flake8_pydantic/visitor.py b/src/flake8_pydantic/visitor.py
index b3e2107..8274e99 100644
--- a/src/flake8_pydantic/visitor.py
+++ b/src/flake8_pydantic/visitor.py
@@ -50,6 +50,7 @@ def _check_pyd_002(self, node: ast.ClassDef) -> None:
                 if isinstance(assign, ast.Assign)
                 if isinstance(assign.targets[0], ast.Name)
                 if not assign.targets[0].id.startswith("_")
+                if not assign.targets[0].id == "model_config"
             ]
             for assignment in invalid_assignments:
                 self.errors.append(PYD002.from_node(assignment))


Test patch:
diff --git a/tests/rules/test_pyd002.py b/tests/rules/test_pyd002.py
index f185c5b..dc1d120 100644
--- a/tests/rules/test_pyd002.py
+++ b/tests/rules/test_pyd002.py
@@ -17,6 +17,11 @@ class Model(BaseModel):
     _a = 1
 """
 
+PYD002_MODEL_MODEL_CONFIG = """
+class Model(BaseModel):
+    model_config = {}
+"""
+
 PYD002_DATACLASS = """
 @dataclass
 class Model:
@@ -29,6 +34,7 @@ class Model:
     [
         (PYD002_MODEL, [PYD002(3, 4)]),
         (PYD002_MODEL_PRIVATE_FIELD, []),
+        (PYD002_MODEL_MODEL_CONFIG, []),
         (PYD002_DATACLASS, []),
     ],
 )