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 - reST Class Reference Handling for `:return:` #215

Closed rmartin16 closed 1 year ago

rmartin16 commented 1 year ago

v1.7.1 is incorrectly modifying several reST references for my :return: documentation.

@@ -2,7 +2,8 @@ def _session(self):
     """
     Create or return existing HTTP session.

-    :return: Requests :class:`~requests.Session` object
+    :return: Requests
+    :class: `~requests.Session` object
     """
     pass

Although, this one is not reformatted:

def torrents_upload_limit(self, torrent_hashes=None, **kwargs):
    """
    Retrieve the upload limit for one or more torrents.

    :param torrent_hashes: single torrent hash or list of torrent hashes. Or ``all`` for all torrents.
    :return: :class:`TorrentLimitsDictionary`
    """
    pass

Config:

  - repo: https://github.com/PyCQA/docformatter
    rev: v1.7.1
    hooks:
      - id: docformatter
        args: [--in-place, --pre-summary-newline, --black]

more examples: https://github.com/rmartin16/qbittorrent-api/pull/210