diff mbox series

Update to clang-format script

Message ID bbc58b5a56a29ca6bdd7e4890742e9c@cweb009.nm.nfra.io
State New
Headers show
Series Update to clang-format script | expand

Commit Message

Ray Kim June 23, 2019, 9:39 a.m. UTC
GNU style brace wrapping rules have been added to clang-format quite a while ago.
http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?revision=197138&view=markup
This simple patch proposes to use the built-in rules instead of the custom brace rules.

Ray Kim

2019-06-27  Ray Kim  <msca8h@naver.com>
* contrib/clang-format: Changed the custom brace wrapping rules to built-in GNU style.

Comments

Martin Liška June 24, 2019, 3:58 a.m. UTC | #1
On 6/23/19 11:39 AM, 김규래 wrote:
> GNU style brace wrapping rules have been added to clang-format quite a while ago.
> http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Format/Format.h?revision=197138&view=markup
> This simple patch proposes to use the built-in rules instead of the custom brace rules.

I like the changes, please install the patch.

Martin

> 
> Ray Kim
> 
> 2019-06-27  Ray Kim  <msca8h@naver.com>
> * contrib/clang-format: Changed the custom brace wrapping rules to built-in GNU style.
> 
> diff --git a/contrib/clang-format b/contrib/clang-format
> index d734001c06f..3ebb85fff77 100644
> --- a/contrib/clang-format
> +++ b/contrib/clang-format
> @@ -25,20 +25,8 @@ AccessModifierOffset: -2
>   AlwaysBreakAfterDefinitionReturnType: All
>   BinPackArguments: true
>   BinPackParameters: true
> -BraceWrapping:
> -  AfterClass: true
> -  AfterControlStatement: true
> -  AfterEnum: true
> -  AfterFunction: true
> -  AfterNamespace: false
> -  AfterObjCDeclaration: true
> -  AfterStruct: true
> -  AfterUnion: true
> -  BeforeCatch: true
> -  BeforeElse: true
> -  IndentBraces: true
>   BreakBeforeBinaryOperators: All
> -BreakBeforeBraces: Custom
> +BreakBeforeBraces: GNU
>   BreakBeforeTernaryOperators: true
>   ColumnLimit: 80
>   ConstructorInitializerIndentWidth: 2
>
diff mbox series

Patch

diff --git a/contrib/clang-format b/contrib/clang-format
index d734001c06f..3ebb85fff77 100644
--- a/contrib/clang-format
+++ b/contrib/clang-format
@@ -25,20 +25,8 @@  AccessModifierOffset: -2
 AlwaysBreakAfterDefinitionReturnType: All
 BinPackArguments: true
 BinPackParameters: true
-BraceWrapping:
-  AfterClass: true
-  AfterControlStatement: true
-  AfterEnum: true
-  AfterFunction: true
-  AfterNamespace: false
-  AfterObjCDeclaration: true
-  AfterStruct: true
-  AfterUnion: true
-  BeforeCatch: true
-  BeforeElse: true
-  IndentBraces: true
 BreakBeforeBinaryOperators: All
-BreakBeforeBraces: Custom
+BreakBeforeBraces: GNU
 BreakBeforeTernaryOperators: true
 ColumnLimit: 80
 ConstructorInitializerIndentWidth: 2