Skip to content

Commit 0b9afef

Browse files
authored
Merge pull request #5 from SingularityX-ai/sdg-595/fix_formatting
Update common.py
2 parents 3ab5aef + 4b48606 commit 0b9afef

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

PyDocSmith/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ def format_docstring_to_pep257(docstring: Docstring, width: int = 72) -> Docstri
242242
for meta in docstring.meta:
243243
if meta.description:
244244
# Ensure meta descriptions are wrapped according to PEP 8
245-
meta.description = textwrap.fill(meta.description.strip(), width)
245+
split_description = meta.description.split("\n")
246+
for itm, idx in enumerate(split_description):
247+
split_description[idx] = textwrap.fill(itm.strip(), width)
248+
249+
meta.description = "\n".join(split_description)
246250
if meta.args:
247251
# Clean up args to ensure they are stripped of extra spaces
248252
meta.args = [arg.strip() for arg in meta.args if arg.strip()]

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="PyDocSmith",
5-
version="0.1.3",
5+
version="0.1.4",
66
description="It parses and composes docstrings in Google, Numpydoc, ReST and Epydoc.",
77
long_description=open("README.md").read(),
88
long_description_content_type="text/markdown",

0 commit comments

Comments
 (0)