---
source: crates/ruff_linter/src/rules/pydoclint/mod.rs
snapshot_kind: text
---
DOC201_google.py:3:5: DOC201 `return` is not documented in docstring
  |
1 |   # DOC201
2 |   def foo(num: int) -> str:
3 |       """
  |  _____^
4 | |     Do something
5 | | 
6 | |     Args:
7 | |         num (int): A number
8 | |     """
  | |_______^ DOC201
9 |       return 'test'
  |
  = help: Add a "Returns" section to the docstring

DOC201_google.py:44:9: DOC201 `return` is not documented in docstring
   |
42 |       # DOC201
43 |       def bar(self) -> str:
44 |           """
   |  _________^
45 | |         Do something
46 | | 
47 | |         Args:
48 | |             num (int): A number
49 | |         """
   | |___________^ DOC201
50 |           return 'test'
   |
   = help: Add a "Returns" section to the docstring

DOC201_google.py:70:9: DOC201 `return` is not documented in docstring
   |
68 |     # DOC201
69 |     def nested():
70 |         """Do something nested."""
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^ DOC201
71 |         return 5
   |
   = help: Add a "Returns" section to the docstring

DOC201_google.py:120:9: DOC201 `return` is not documented in docstring
    |
118 |     @abc.abstractmethod
119 |     def f(self):
120 |         """Lorem ipsum."""
    |         ^^^^^^^^^^^^^^^^^^ DOC201
121 |         return True
    |
    = help: Add a "Returns" section to the docstring

DOC201_google.py:178:5: DOC201 `return` is not documented in docstring
    |
176 |   # DOC201 - non-early return explicit None
177 |   def foo(x: int) -> int | None:
178 |       """A very helpful docstring.
    |  _____^
179 | | 
180 | |     Args:
181 | |         x (int): An integer.
182 | |     """
    | |_______^ DOC201
183 |       if x < 0:
184 |           return None
    |
    = help: Add a "Returns" section to the docstring

DOC201_google.py:191:5: DOC201 `return` is not documented in docstring
    |
189 |   # DOC201 - non-early return explicit None w/o useful type annotations
190 |   def foo(x):
191 |       """A very helpful docstring.
    |  _____^
192 | | 
193 | |     Args:
194 | |         x (int): An integer.
195 | |     """
    | |_______^ DOC201
196 |       if x < 0:
197 |           return None
    |
    = help: Add a "Returns" section to the docstring

DOC201_google.py:204:5: DOC201 `return` is not documented in docstring
    |
202 |   # DOC201 - only returns None, but return annotation is not None
203 |   def foo(s: str) -> str | None:
204 |       """A very helpful docstring.
    |  _____^
205 | | 
206 | |     Args:
207 | |         s (str): A string.
208 | |     """
    | |_______^ DOC201
209 |       return None
    |
    = help: Add a "Returns" section to the docstring
