Fix the doc filter to check only args values (#416)

This commit is contained in:
Valentin
2023-03-30 14:23:50 +02:00
committed by GitHub
parent dd57ef8329
commit 4577717bc9

View File

@@ -72,9 +72,9 @@ autodoc_preserve_defaults = True
# the class docstring.
def remove_lines_before_parameters(app, what, name, obj, options, lines):
if what == "class":
# ":" represents args values such as :param: or :raises:
# ":param" represents args values
first_idx_to_keep = next(
(i for i, line in enumerate(lines) if line.startswith(":")), 0
(i for i, line in enumerate(lines) if line.startswith(":param")), 0
)
lines[:] = lines[first_idx_to_keep:]