Skip to content

Commit 6df629d

Browse files
vsajipmhils
andauthored
If a docstring fails assertion checks, output the offending docstring… (#458)
* If a docstring fails assertion checks, Output the offending docstring to help the user pinpoint the problem. * Update docstrings.py Co-authored-by: Maximilian Hils <git@maximilianhils.com>
1 parent b711089 commit 6df629d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pdoc/docstrings.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,8 @@ def _indented_list(contents: str) -> list[str]:
104104
]
105105
"""
106106
# we expect this to be through cleandoc() already.
107-
assert not contents.startswith(" ")
108-
assert not contents.startswith("\n")
109-
assert "\t" not in contents
107+
assert not contents.startswith(" "), contents
108+
assert not contents.startswith("\n"), contents
110109

111110
ret: list[str] = []
112111
for line in contents.splitlines(keepends=True):

0 commit comments

Comments
 (0)