---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI012.pyi:5:5: PYI012 [*] Class body must not contain `pass`
  |
3 | class OneAttributeClass:
4 |     value: int
5 |     pass  # PYI012 Class body must not contain `pass`
  |     ^^^^ PYI012
6 | 
7 | class OneAttributeClassRev:
  |
  = help: Remove unnecessary `pass`

ℹ Safe fix
2 2 | 
3 3 | class OneAttributeClass:
4 4 |     value: int
5   |-    pass  # PYI012 Class body must not contain `pass`
6 5 | 
7 6 | class OneAttributeClassRev:
8 7 |     pass  # PYI012 Class body must not contain `pass`

PYI012.pyi:8:5: PYI012 [*] Class body must not contain `pass`
  |
7 | class OneAttributeClassRev:
8 |     pass  # PYI012 Class body must not contain `pass`
  |     ^^^^ PYI012
9 |     value: int
  |
  = help: Remove unnecessary `pass`

ℹ Safe fix
5 5 |     pass  # PYI012 Class body must not contain `pass`
6 6 | 
7 7 | class OneAttributeClassRev:
8   |-    pass  # PYI012 Class body must not contain `pass`
9 8 |     value: int
10 9 | 
11 10 | class DocstringClass:

PYI012.pyi:16:5: PYI012 [*] Class body must not contain `pass`
   |
14 |     """
15 | 
16 |     pass  # PYI012 Class body must not contain `pass`
   |     ^^^^ PYI012
17 | 
18 | class NonEmptyChild(Exception):
   |
   = help: Remove unnecessary `pass`

ℹ Safe fix
13 13 |     My body only contains pass.
14 14 |     """
15 15 | 
16    |-    pass  # PYI012 Class body must not contain `pass`
17 16 | 
18 17 | class NonEmptyChild(Exception):
19 18 |     value: int

PYI012.pyi:20:5: PYI012 [*] Class body must not contain `pass`
   |
18 | class NonEmptyChild(Exception):
19 |     value: int
20 |     pass  # PYI012 Class body must not contain `pass`
   |     ^^^^ PYI012
21 | 
22 | class NonEmptyChild2(Exception):
   |
   = help: Remove unnecessary `pass`

ℹ Safe fix
17 17 | 
18 18 | class NonEmptyChild(Exception):
19 19 |     value: int
20    |-    pass  # PYI012 Class body must not contain `pass`
21 20 | 
22 21 | class NonEmptyChild2(Exception):
23 22 |     pass  # PYI012 Class body must not contain `pass`

PYI012.pyi:23:5: PYI012 [*] Class body must not contain `pass`
   |
22 | class NonEmptyChild2(Exception):
23 |     pass  # PYI012 Class body must not contain `pass`
   |     ^^^^ PYI012
24 |     value: int
   |
   = help: Remove unnecessary `pass`

ℹ Safe fix
20 20 |     pass  # PYI012 Class body must not contain `pass`
21 21 | 
22 22 | class NonEmptyChild2(Exception):
23    |-    pass  # PYI012 Class body must not contain `pass`
24 23 |     value: int
25 24 | 
26 25 | class NonEmptyWithInit:

PYI012.pyi:28:5: PYI012 [*] Class body must not contain `pass`
   |
26 | class NonEmptyWithInit:
27 |     value: int
28 |     pass  # PYI012 Class body must not contain `pass`
   |     ^^^^ PYI012
29 | 
30 |     def __init__():
   |
   = help: Remove unnecessary `pass`

ℹ Safe fix
25 25 | 
26 26 | class NonEmptyWithInit:
27 27 |     value: int
28    |-    pass  # PYI012 Class body must not contain `pass`
29 28 | 
30 29 |     def __init__():
31 30 |         pass


