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

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

DOC201 `return` is not documented in docstring
   --> DOC201_google.py:178:5
    |
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 | |     """
    | |_______^
183 |       if x < 0:
184 |           return None
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_google.py:191:5
    |
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 | |     """
    | |_______^
196 |       if x < 0:
197 |           return None
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_google.py:204:5
    |
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 | |     """
    | |_______^
209 |       return None
    |
help: Add a "Returns" section to the docstring
