Skip to content

Require spaces at the beginning of empty lines #2419

@kampro

Description

@kampro

Is there a possibility to force SwiftFromat to require spaces at the beginning of empty lines to match indentation of the surrounding code? The way like Xcode formats code.
For example, when I use --trim-whitespace nonblank-lines the indentation is kept correctly

struct A {
....let a = 123
....
....init() {}
}

but I can write

struct A {
....let a = 123

....init() {}
}

or

struct A {
....let a = 123
..
....init() {}
}

and it won't trigger any error, but I want SwiftFormat to do it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions