From 11d44fda8f08faf576e44e0bdc31cdc4031b8d00 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Tue, 16 Aug 2022 16:09:08 +0000 Subject: [PATCH] Pull in Allman's rules so modifications to BraceWrapping actually do something instead of being ignored because BreakBeforeBraces isn't set to Custom --- .clang-format | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/.clang-format b/.clang-format index 695c3b53e0..c272ac1220 100644 --- a/.clang-format +++ b/.clang-format @@ -12,6 +12,7 @@ AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: true AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: false +AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None @@ -19,24 +20,22 @@ AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: false BinPackArguments: true BinPackParameters: true -BraceWrapping: - AfterClass: false - AfterControlStatement: false - AfterEnum: false +BraceWrapping: + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true AfterFunction: true - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - #AfterExternBlock: false - BeforeCatch: false - BeforeElse: false - IndentBraces: false - #SplitEmptyFunction: true - #SplitEmptyRecord: true - #SplitEmptyNamespace: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: true BreakBeforeBinaryOperators: All -BreakBeforeBraces: Allman +BreakBeforeBraces: Custom BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: true BreakConstructorInitializersBeforeComma: false @@ -65,6 +64,7 @@ IncludeCategories: Priority: 1 IncludeIsMainRegex: '(Test)?$' IndentCaseLabels: true +IndentExternBlock: AfterExternBlock IndentPPDirectives: None IndentWidth: 4 IndentWrappedFunctionNames: false @@ -95,6 +95,6 @@ SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: c++17 +Standard: c++20 TabWidth: 4 UseTab: Never