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

docstring that starts on the first line get wrongly indented #60

Closed
12rambau opened this issue Mar 7, 2023 · 0 comments · Fixed by #61
Closed

docstring that starts on the first line get wrongly indented #60

12rambau opened this issue Mar 7, 2023 · 0 comments · Fixed by #61

Comments

@12rambau
Copy link
Contributor

12rambau commented Mar 7, 2023

Expected Behavior

Whatever the convention I select for pydocstring (D212: start on the first line or D213: start on second line) I should get the same results when building documentation with Sphinx. I found out that if I use D212 (default behaviour for ruff) in combination with deprecated, then the indetation is shifted and the parameters are interpreted as quotes.

I created a small repository that you can launch by executing "nox" from the root. that shows the behavior.

This works as expected:

@versionadded(version="0.0.1", reason="because")
def titi (a, b) -> None:
    """
    A one line short description

    pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum

    Args:
        a: the first parameter
        b: a second parameter

    Returns:
        nothing
    """

    return

but this doesn't:

@versionadded(version="0.0.1", reason="because")
def tutu (a, b) -> None:
    """A one line short description

    pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum pim pam poum

    Args:
        a: the first parameter
        b: a second parameter

    Returns:
        nothing
    """

    return

see this RDT page for the result.

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

Successfully merging a pull request may close this issue.

1 participant