Skip to content

unexpected formatting on empty lines #138942

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

Open
kadircet opened this issue May 7, 2025 · 2 comments
Open

unexpected formatting on empty lines #138942

kadircet opened this issue May 7, 2025 · 2 comments

Comments

@kadircet
Copy link
Member

kadircet commented May 7, 2025

command clang-format --lines=2:2 a.cc

actual formatting:

void f() {
  
}

expected formatting:

void f() {}

this seems to be WAI if there are tokens on line 2, e.g:

void f() {
  return;
}

gets formatted as void f() { return; }.

@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/issue-subscribers-clang-format

Author: kadir çetinkaya (kadircet)

command `clang-format --lines=2:2 a.cc`

actual formatting:

void f() {
  
}

expected formatting:

void f() {}

this seems to be WAI if there are tokens on line 2, e.g:

void f() {
  return;
}

gets formatted as void f() { return; }.

@llvmbot
Copy link
Member

llvmbot commented May 7, 2025

@llvm/issue-subscribers-c-1

Author: kadir çetinkaya (kadircet)

command `clang-format --lines=2:2 a.cc`

actual formatting:

void f() {
  
}

expected formatting:

void f() {}

this seems to be WAI if there are tokens on line 2, e.g:

void f() {
  return;
}

gets formatted as void f() { return; }.

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

No branches or pull requests

2 participants