Skip to content

[ENH] Let fmt: skip apply to compound statements, if they share a line. #11216

@randolf-scholz

Description

@randolf-scholz
if True: x = 0  # fmt: skip

def foo(self, lorem, ipsum, dolor, sit, amet, consectetur, adipiscing, elit, sed, do): ...  # fmt: skip

Gets reformatted to

if True:
    x = 0  # fmt: skip

def foo(
    self, lorem, ipsum, dolor, sit, amet, consectetur, adipiscing, elit, sed, do
): ...  # fmt: skip

Which is because fmt: skip only applies to the preceding statement. However, it would be useful to apply the fmt: skip to the whole compound statement in this context. For instance, when formatting @overload decorated functions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingformatterRelated to the formattersuppressionRelated to supression of violations e.g. noqa

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions