Skip to content

The docformatter adds blank line between ocstring and async with block (conflicts with Ruff (pydocsyle)) #351

@yukihiko-shinoda

Description

@yukihiko-shinoda

When we use async with block, docformatter adds blank line between ocstring and async with block.

How to reproduce

Crate test.py:

"""Example."""

import asyncio

lock = asyncio.Lock()


async def example() -> None:
    """Example."""
    async with lock:
        pass

And run docformatter:

$ docformatter --diff example.py 
--- before/example.py
+++ after/example.py
@@ -7,5 +7,6 @@
 
 async def example() -> None:
     """Example."""
+
     async with lock:
         pass

After formatting by docstring, Ruff (and pydocstyle) fixes it to no lines.

blank-line-after-function (D202) | Ruff

I tested docformatter v1.7.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    freshThis is a new issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions