dadadel / pyment

Format and convert Python docstrings and generates patches
GNU General Public License v3.0
905 stars 62 forks source link

`return """something"""` is mistaken as docstring if it's at the first line of a function #87

Closed spotlesstofu closed 3 years ago

spotlesstofu commented 4 years ago

This:

    def __str__(self):
        return '''\
Autodiscover endpoint: %s
Auth type: %s''' % (
            self.service_endpoint,
            self.auth_type,
        )

becomes this (after running pyment):

    def __str__(self):
        """

        Args:

        Returns:
          Autodiscover endpoint: %s
          Auth type: %s''' % (

        """
            self.service_endpoint,
            self.auth_type,
        )

To replicate, run pyment -o google -p False -t -w on this file

dadadel commented 3 years ago

Hi @spotlesstofu, Thanks for reporting. This issue is addressed by the issue #90 and was fixed by the PR #91 in current master.