Skip to content

Formatter incompatibility: ellipses are not inlined in .py files #7440

@charliermarsh

Description

@charliermarsh

Given:

def f(): ...

def f():
    ...

def f():
    """Docstring"""
    ...

Recent versions of Black format as:

def f(): ...


def f(): ...


def f():
    """Docstring"""
    ...

While Ruff formats as:

def f():
    ...


def f():
    ...


def f():
    """Docstring"""
    ...

This changed in Black 23.9.0 (psf/black#3796).

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatterpreviewRelated to preview mode features

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions