PyCQA / docformatter

Formats docstrings to follow PEP 257
https://pypi.python.org/pypi/docformatter
MIT License
526 stars 61 forks source link

Word deleted in formating #159

Closed f4hy closed 1 year ago

f4hy commented 1 year ago

I have a bug where docformatter deletes a word in the docstring. Very odd.

#example.py
class Foobar():
    """Blah blah.

    This will normally be used with https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx to generate the xxx
    """

running docformatter on this

>docformatter example.py
--- before/example.py
+++ after/example.py
@@ -1,5 +1,8 @@
 class Foobar():
     """Blah blah.

-    This will normally be used with https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx to generate the xxx
+    This will normally be used with
+    https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx
+    tothe
+    xxx
     """

Very weird it deleted the word generate and has no space between to and the. I have not figured out the cause yet but this is problematic to delete a word

f4hy commented 1 year ago

This is using 1.5.1

weibullguy commented 1 year ago

@f4hy Can you try using 1.6.0-rc2? This is the result I get when using 1.6.0-rc2:

 class Foobar():
     """Blah blah.

-    This will normally be used with https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx to generate the xxx
+    This will normally be used with
+    https://aaaaaaaa.bbb.ccccccccc.com/xxxxx/xxx_xxxxxxxxxxx
+    to generate the xxx
     """