llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.41k stars 12.15k forks source link

[feat] Clang format blank line after declaration block (C89 style) #91064

Open ilan-schemoul opened 7 months ago

ilan-schemoul commented 7 months ago

It would be awesome to have an option (the name could be BlankLineAfterDeclarationBlock) where in

int main() {
  int a;
  int b;
  printf("%d", a);
}

a newline is inserted between int b; and printf; (useful when we use C89 style/--Werror=declaration-after-statement and we want a newline between declarations/definitions)

llvmbot commented 7 months ago

@llvm/issue-subscribers-clang-format

Author: Ilan Schemoul (ilan-schemoul)

It would be awesome to have an option (the name could be BlankLineAfterDeclarationBlock) where in ```c int main() { int a; int b; printf("%d", a); } ``` a newline is inserted between `int b;` and `printf;` (useful when we use C89 style/--Werror=declaration-after-statement and we want a newline between declarations/definitions)