Skip to content

Formatter: blank_line_after_nested_stub_class preview style #8891

@MichaReiser

Description

@MichaReiser

Implement Black's blank_line_after_nested_stub_class as a preview style. This new style only applies to stub files (.pyi)

class Outer:
    class InnerStub: ...
    outer_attr_after_inner_stub: int
    class Inner:
        inner_attr: int
    outer_attr: int

# output
class Outer:
    class InnerStub: ...
    outer_attr_after_inner_stub: int

    class Inner:
        inner_attr: int

    outer_attr: int

See added new lines after the nested classes (that don't have a dummy body)

Metadata

Metadata

Assignees

Labels

formatterRelated to the formatterhelp wantedContributions especially welcomepreviewRelated to preview mode features

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions