Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exceptions may occur multiple times #250

Open
GabrielSchoenweiler opened this issue Dec 1, 2022 · 1 comment
Open

exceptions may occur multiple times #250

GabrielSchoenweiler opened this issue Dec 1, 2022 · 1 comment
Labels

Comments

@GabrielSchoenweiler
Copy link

Description
when a certain exception is raised on multiple lines within the function, the exception will occur multiple times in the docstring.

Versions:

  • autoDocstring Version: v0.6.1
  • Operating System: Win 10
  • Vscode Version: 1.73.0

Original Code

def TestFxn(arg0: int, arg1: str) -> str:
        if len(arg1) * arg0 > 1000:
            raise ValueError("bad idea... too many chars")
        if not arg1:
            raise ValueError("empty string")

        return arg1 * arg0

Expected Result:

def TestFxn(arg0: int, arg1: str) -> str:
        """_summary_

        Args:
            arg0 (int): _description_
            arg1 (str): _description_

        Raises:
            ValueError: _description_

        Returns:
            str: _description_
        """

Actual Result:

def TestFxn(arg0: int, arg1: str) -> str:
        """_summary_

        Args:
            arg0 (int): _description_
            arg1 (str): _description_

        Raises:
            ValueError: _description_
            ValueError: _description_

        Returns:
            str: _description_
        """
@GabrielSchoenweiler
Copy link
Author

this could be done with a lambda {{#skipDuplicates}} for example...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant