Skip to content

Commit c2f93ef

Browse files
committed
fixed docstring formatting
1 parent 54eb504 commit c2f93ef

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/sasctl/utils/decorators.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ def _insert_docstring_text(func, text):
2929

3030
docstring = docstring.strip()
3131

32-
text = ('',
33-
text,
34-
'')
32+
# Sphinx formatting requires 2 blank lines after a numpydoc section or one
33+
# blank line after another Sphinx directive.
34+
if docstring.split('\n')[-1].startswith('.. '):
35+
# Last line is another Sphinx directive
36+
gap = '\n\n'
37+
else:
38+
gap = '\n\n\n'
3539

36-
return docstring + '\n'.join(text)
40+
return docstring + gap + text + '\n'
3741

3842

3943
def deprecated(reason=None, version=None, removed_in=None):

0 commit comments

Comments
 (0)