---
source: crates/ruff/src/rules/flake8_pie/mod.rs
---
PIE794.py:4:5: PIE794 [*] Class field `name` is defined multiple times
  |
4 |     name = StringField()
5 |     # ....
6 |     name = StringField()  # PIE794
  |     ^^^^^^^^^^^^^^^^^^^^ PIE794
7 | 
8 |     def remove(self) -> None:
  |
  = help: Remove duplicate field definition for `name`

ℹ Suggested fix
1 1 | class Foo(BaseModel):
2 2 |     name = StringField()
3 3 |     # ....
4   |-    name = StringField()  # PIE794
5 4 | 
6 5 |     def remove(self) -> None:
7 6 |         ...

PIE794.py:13:5: PIE794 [*] Class field `name` is defined multiple times
   |
13 |     name: str = StringField()
14 |     # ....
15 |     name = StringField()  # PIE794
   |     ^^^^^^^^^^^^^^^^^^^^ PIE794
16 | 
17 |     def foo(self) -> None:
   |
   = help: Remove duplicate field definition for `name`

ℹ Suggested fix
10 10 | class Foo(BaseModel):
11 11 |     name: str = StringField()
12 12 |     # ....
13    |-    name = StringField()  # PIE794
14 13 | 
15 14 |     def foo(self) -> None:
16 15 |         ...

PIE794.py:23:5: PIE794 [*] Class field `bar` is defined multiple times
   |
23 |     foo: bool = BooleanField()
24 |     # ...
25 |     bar = StringField()  # PIE794
   |     ^^^^^^^^^^^^^^^^^^^ PIE794
   |
   = help: Remove duplicate field definition for `bar`

ℹ Suggested fix
20 20 |     bar: str = StringField()
21 21 |     foo: bool = BooleanField()
22 22 |     # ...
23    |-    bar = StringField()  # PIE794
24 23 | 
25 24 | 
26 25 | class User(BaseModel):

PIE794.py:40:5: PIE794 [*] Class field `bar` is defined multiple times
   |
40 |     foo: bool = BooleanField()
41 |     # ...
42 |     bar = StringField()  # PIE794
   |     ^^^^^^^^^^^^^^^^^^^ PIE794
   |
   = help: Remove duplicate field definition for `bar`

ℹ Suggested fix
37 37 |     bar: str = StringField()
38 38 |     foo: bool = BooleanField()
39 39 |     # ...
40    |-    bar = StringField()  # PIE794


