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

DOC201 `return` is not documented in docstring
  --> DOC201_numpy.py:54:9
   |
52 |       # DOC201
53 |       def bar(self) -> str:
54 | /         """
55 | |         Do something
56 | |
57 | |         Parameters
58 | |         ----------
59 | |         num : int
60 | |             A number
61 | |         """
   | |___________^
62 |           return 'test'
   |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
  --> DOC201_numpy.py:86:9
   |
84 |     @abc.abstractmethod
85 |     def f(self):
86 |         """Lorem ipsum."""
   |         ^^^^^^^^^^^^^^^^^^
87 |         return True
   |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:152:5
    |
150 |   # DOC201 - non-early return explicit None
151 |   def foo(x: int) -> int | None:
152 | /     """A very helpful docstring.
153 | |
154 | |     Parameters
155 | |     ----------
156 | |     x : int
157 | |         An integer.
158 | |     """
    | |_______^
159 |       if x < 0:
160 |           return None
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:167:5
    |
165 |   # DOC201 - non-early return explicit None w/o useful type annotations
166 |   def foo(x):
167 | /     """A very helpful docstring.
168 | |
169 | |     Parameters
170 | |     ----------
171 | |     x : int
172 | |         An integer.
173 | |     """
    | |_______^
174 |       if x < 0:
175 |           return None
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:182:5
    |
180 |   # DOC201 - only returns None, but return annotation is not None
181 |   def foo(s: str) -> str | None:
182 | /     """A very helpful docstring.
183 | |
184 | |     Parameters
185 | |     ----------
186 | |     x : str
187 | |         A string.
188 | |     """
    | |_______^
189 |       return None
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:194:5
    |
192 | # DOC201
193 | def bar() -> int | None:
194 |     """Bar-y method"""
    |     ^^^^^^^^^^^^^^^^^^
195 |     return
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:220:5
    |
218 | # indicates it could sometimes return `int`
219 | def generator_function_3() -> Generator[str, None, int | None]:
220 |     """Generate some strings"""
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
221 |     yield from "abc"
222 |     return
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:228:5
    |
226 | # indicates it could sometimes return `int`
227 | def generator_function_4():
228 |     """Generate some strings"""
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
229 |     yield from "abc"
230 |     return 42
    |
help: Add a "Returns" section to the docstring

DOC201 `return` is not documented in docstring
   --> DOC201_numpy.py:235:5
    |
233 | # DOC201 -- no `yield` expressions, so not a generator function
234 | def not_a_generator() -> Iterator[int]:
235 |     """"No returns documented here, oh no"""
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
236 |     return (x for x in range(42))
    |
help: Add a "Returns" section to the docstring
