Skip to content

Commit 5a58ed1

Browse files
jspaezpDanielNoord
andauthored
fixed bug where empty summaries fail with index error (#163)
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
1 parent 60a82b3 commit 5a58ed1

File tree

4 files changed

+7
-1
lines changed

4 files changed

+7
-1
lines changed

pydocstringformatter/_formatting/formatters_default.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ def treat_summary(
8888
# ending quotes
8989
line_length -= quotes_length + 1
9090

91-
summary_lines = summary.splitlines()
91+
if not (summary_lines := summary.splitlines()):
92+
summary_lines = [""]
9293

9394
new_summary = "\n".join(
9495
textwrap.wrap(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--linewrap-full-docstring
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class GithubIssue151:
2+
""" """
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class GithubIssue151:
2+
""""""

0 commit comments

Comments
 (0)