Skip to content

No blank line after if/for/while/def, etc. #1091

Open
@ehats

Description

@ehats

Currently, yapf formats the following code:

if True:




    print(2)

like this:

if True:

    print(2)

However, I don't want to have blank lines right at the beginning of blocks, e.g. I want yapf to do this:

if True:
    print(2)

I thought that a knob would exist for this for sure, but I wasn't able to find it - could you please point me in the right direction?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions