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

seemingly correct format reformatted? #78

Closed
jjenniferdai opened this issue Sep 20, 2021 · 4 comments
Closed

seemingly correct format reformatted? #78

jjenniferdai opened this issue Sep 20, 2021 · 4 comments
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: enhancement Feature that is outside the scope of PEP 257
Milestone

Comments

@jjenniferdai
Copy link

hi, docformatter edits this seemingly correct format, is there something we're missing?

Lightning-AI/pytorch-lightning@6d12d69

Adding an extra line (Lightning-AI/pytorch-lightning#9422 (comment)) seems to make docformatter happy, was there something off with the original though? Thank you!

@merwok
Copy link

merwok commented Sep 20, 2021

Doesn’t reST require a blank line between the directive with its parameter and the body of the directive?

@weibullguy
Copy link
Member

I believe this portion of the docstring .. deprecated:: v1.5 is a Sphinx directive which is not really addressed in PEP-257 with regards to how they should be handled. Properly handling these directives would be a welcome enhancement. See also #60.

@weibullguy weibullguy added the C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) label Aug 6, 2022
@weibullguy weibullguy added this to the v2.0.0 milestone Aug 21, 2022
@akihironitta
Copy link

As suggested in Lightning-AI/pytorch-lightning#9422 (comment), one workaround is:

def close():
    """Do any cleanup that is necessary to close an experiment.

    Having this line avoids the formatting.

    .. deprecated:: v1.5
        This method is deprecated in v1.5 and will be removed in v1.7.
        Please use ``something something`` instead.
    """

@weibullguy
Copy link
Member

@jjenniferdai with v1.6.2 (and possibly earlier versions), the following remains untouched by docformatter unless passing the --force-wrap argument.

def close(self) -> None:
    """Do any cleanup that is necessary to close an experiment.

    .. deprecated:: v1.5
        This method is deprecated in v1.5 and will be removed in v1.7.
        Please use `LightningLoggerBase.finalize` instead.
    """

I'm closing this since the reported issue is no longer the behavior of docformatter. Handling of Sphinx directives and various docstring syntaxes is still planned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: style Relates to docstring format style (e.g., Google, NumPy, Sphinx) P: enhancement Feature that is outside the scope of PEP 257
Projects
None yet
Development

No branches or pull requests

4 participants