You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Check that indent on first line of section didn't get weird first_section=Trueforsectioninnew_sections.values():
iffirst_section:
section[0] =section[0].lstrip()
first_section=Falseeliflen(section[0]) >0andnotsection[0][0].isspace(): # <<<<<< this is the fixsection[0] =f"{' '*indent_length:s}{section[0]:s}"
summary_lines = summary.splitlines()
# Here is the fix, checks if the summary line is empty before going though
if len(summary_lines) == 0:
summary_lines = [""]
new_summary = "\n".join(
textwrap.wrap(
summary_lines[0],
width=line_length,
initial_indent=" " * (indent_length + quotes_length),
subsequent_indent=" " * indent_length,
replace_whitespace=True,
)
)[indent_length + quotes_length :]
The text was updated successfully, but these errors were encountered:
Issue
This call fails with an index error because
section[0]
has length 0, thereforesection[0][0]
returns an index error.Fix
Modifying:
pydocstringformatter/pydocstringformatter/_formatting/base.py
Lines 275 to 282 in c749fc6
To:
Related:
Breaking call:
Fix:
pydocstringformatter/pydocstringformatter/_formatting/formatters_default.py
Lines 91 to 101 in c749fc6
The text was updated successfully, but these errors were encountered: