Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
andre-richter opened this issue Sep 17, 2024 · 2 comments

Comments

@andre-richter
Copy link

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.

@ahoppen
Copy link
Member

ahoppen commented Sep 17, 2024

Synced to Apple’s issue tracker as rdar://136130930

@allevato
Copy link
Member

@mateusrodriguesxyz Would you be able to take a look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants