Skip to content

NoEmptyLinesOpeningClosingBraces removes empty lines from body if functions start/end with comment  #807

Closed
@andre-richter

Description

@andre-richter

The following, when NoEmptyLinesOpeningClosingBraces is true,

func foo() {
  let x = 1

  // let y = 2
  // let z = 3
}

results in

func foo() {
  let x = 1
  // let y = 2
  // let z = 3
}

It also happens the other way around.

func foo() {
  // let w = 0

  let x = 1
}

becomes

func foo() {
  // let w = 0
  let x = 1
}

IMO both cases should be left unchanged, because these empty lines will likely be intentional. Also, in the stricter sense, they are not located after/before the opening/closing braces.

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