---
source: crates/ruff_linter/src/rules/flake8_pyi/mod.rs
---
PYI021 [*] Docstrings should not be included in stubs
 --> PYI021.pyi:1:1
  |
1 | """foo"""  # ERROR PYI021
  | ^^^^^^^^^
2 |
3 | def foo():
  |
help: Remove docstring
  |
  - """foo"""  # ERROR PYI021
1 +   # ERROR PYI021
2 |
  |
note: This is an unsafe fix and may change runtime behavior

PYI021 [*] Docstrings should not be included in stubs
 --> PYI021.pyi:4:5
  |
3 | def foo():
4 |     """foo"""  # ERROR PYI021
  |     ^^^^^^^^^
5 |
6 | class Bar:
  |
help: Remove docstring
  |
3 | def foo():
  -     """foo"""  # ERROR PYI021
4 +     ...  # ERROR PYI021
5 |
  |
note: This is an unsafe fix and may change runtime behavior

PYI021 [*] Docstrings should not be included in stubs
 --> PYI021.pyi:7:5
  |
6 | class Bar:
7 |     """bar"""  # ERROR PYI021
  |     ^^^^^^^^^
8 |
9 | class Qux:
  |
help: Remove docstring
  |
6 | class Bar:
  -     """bar"""  # ERROR PYI021
7 +     ...  # ERROR PYI021
8 |
  |
note: This is an unsafe fix and may change runtime behavior

PYI021 [*] Docstrings should not be included in stubs
  --> PYI021.pyi:10:5
   |
 9 | class Qux:
10 |     """qux"""  # ERROR PYI021
   |     ^^^^^^^^^
11 |
12 |     def __init__(self) -> None: ...
   |
help: Remove docstring
   |
9  | class Qux:
   -     """qux"""  # ERROR PYI021
10 +       # ERROR PYI021
11 |
   |
note: This is an unsafe fix and may change runtime behavior

PYI021 [*] Docstrings should not be included in stubs
  --> PYI021.pyi:15:5
   |
14 |   class Baz:
15 | /     """Multiline docstring
16 | |
17 | |     Lorem ipsum dolor sit amet
18 | |     """
   | |_______^
19 |
20 |       def __init__(self) -> None: ...
   |
help: Remove docstring
   |
14 | class Baz:
   -     """Multiline docstring
   -
   -     Lorem ipsum dolor sit amet
   -     """
15 +     
16 |
   |
note: This is an unsafe fix and may change runtime behavior
