Skip to content

Formatter undocumented deviation: No blank line added between decorated inner classes in pyi files #8747

Open
@henribru

Description

class Foo:
    @foo
    class Bar: ...
    @foo
    class Baz: ...

With default settings (no settings in pyproject.toml) ruff format . leaves this code unchanged. black . adds an empty line between the two inner classes. Reproduced with Ruff 0.1.6 and Black 23.11.0.

Unfortunately I can't give you a playground reproduction for Ruff since it assumes files are .py, but here's one for Black as its playground supports it: https://black.vercel.app/?version=stable&state=_Td6WFoAAATm1rRGAgAhARYAAAB0L-Wj4ACqAGFdAD2IimZxl1N_WlXnON2nzNX9HFvHx6cBLwL3Qwwh1eRAPLFFFWljgvmpOKOffkrecPNUT9AKbB5TWcHByQZl7G4uT9jIT7lav7JhqiztyvUmJIr2-kI3P8tLXaxrmogstgAAAAAANPCqLcjD5SoAAX2rAQAAACADosuxxGf7AgAAAAAEWVo=

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    formatterRelated to the formatterstyleHow should formatted code look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions