PyCQA / docformatter

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

v1.7.1/v1.7.2-rc2 - Space added after Sphinx directives without content #224

Closed rmartin16 closed 1 year ago

rmartin16 commented 1 year ago

Separating out my footnote in https://github.com/PyCQA/docformatter/issues/216#issuecomment-1559785337 in to this issue.

There's a space being appended after raises xxx: and :param xxx: directives if there's no additional content. This then triggers black (as well as ruff) to remove the trailing whitespace.

class Example:
    def torrents_rename(self, torrent_hash, new_name):
         """
         Rename a torrent folder.

-        :raises MissingRequiredParameters400Error:
-        :raises NotFound404Error:
-        :raises Conflict409Error:
-
-        :param torrent_hash:
-        :param new_name:
+        :raises MissingRequiredParameters400Error: 
+        :raises NotFound404Error: 
+        :raises Conflict409Error: 
+        :param torrent_hash: 
+        :param new_name: 
         :return:
         """
         pass
weibullguy commented 1 year ago

@rmartin16 v1.7.2-rc3 should fix this issue. Thanks for all the feedback and your patience getting these issues resolved.

rmartin16 commented 1 year ago

Resolved for me in v1.7.2-rc3. Thanks :)

weibullguy commented 1 year ago

Closing this issue to #231.

rmartin16 commented 1 year ago

This one is back in 1.7.2-rc8 it seems.

 class Example:
     def add_trackers():
         """
         Add trackers to a torrent.

-        :raises NotFound404Error:
-
+        :raises NotFound404Error: 
         :param torrent_hash: hash for torrent
         :param urls: tracker URLs to add to torrent
         :return: None
         """
         pass
weibullguy commented 1 year ago

Should be fixed in v1.7.2.