Skip to content

Formatter: Ellipses in stub files get formatted on a single line #5822

@konstin

Description

@konstin

If a class, method or function is stub out with an ellipsis (...), black gives them their own line in python files and appends them end-of-line after the colon in stub files:

scratch.py

class Animal:
    ...


class Cat(Animal):
    def meow(self):
        ...


def f():
    ...

scratch.pyi

class Animal: ...

class Cat(Animal):
    def meow(self): ...

def f(): ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    formatterRelated to the formattergood first issueGood for newcomershelp wantedContributions especially welcome

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions