From 1214b7e7d921e331fb1480c7e5d579ffa5811cda Mon Sep 17 00:00:00 2001 From: Gunnar Mills Date: Thu, 4 Jun 2020 10:11:30 -0500 Subject: clang-format: update to latest from docs repo This is from openbmc/docs/style/cpp/.clang-format Other OpenBMC repos are doing the same. Tested: Built and validator passed. Change-Id: Ief26c755c9ce012823e16a506342b0547a53517a Signed-off-by: Gunnar Mills --- .clang-format | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) (limited to '.clang-format') diff --git a/.clang-format b/.clang-format index d17cf52d4b..52ac0a17d4 100644 --- a/.clang-format +++ b/.clang-format @@ -5,7 +5,7 @@ AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: false -AlignEscapedNewlinesLeft: false +AlignEscapedNewlines: Right AlignOperands: true AlignTrailingComments: true AllowAllParametersOfDeclarationOnNextLine: true @@ -14,14 +14,13 @@ AllowShortCaseLabelsOnASingleLine: false AllowShortFunctionsOnASingleLine: None AllowShortIfStatementsOnASingleLine: false AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: false +AlwaysBreakTemplateDeclarations: Yes BinPackArguments: true BinPackParameters: true BraceWrapping: - AfterCaseLabel: true + AfterCaseLabel: true AfterClass: true AfterControlStatement: true AfterEnum: true @@ -30,20 +29,27 @@ BraceWrapping: AfterObjCDeclaration: true AfterStruct: true AfterUnion: true + AfterExternBlock: true BeforeCatch: true BeforeElse: true IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false BreakBeforeBinaryOperators: None BreakBeforeBraces: Custom BreakBeforeTernaryOperators: true BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterColon +BreakStringLiterals: true ColumnLimit: 80 CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 Cpp11BracedListStyle: true -DerivePointerAlignment: true +DerivePointerAlignment: false PointerAlignment: Left DisableFormat: false ExperimentalAutoDetectBinPacking: false @@ -52,17 +58,21 @@ ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] IncludeBlocks: Regroup IncludeCategories: - Regex: '^[<"](gtest|gmock)' - Priority: 5 + Priority: 7 - Regex: '^"config.h"' Priority: -1 - - Regex: '^".*\.hpp"' + - Regex: '^".*\.h"' Priority: 1 - - Regex: '^<.*\.h>' + - Regex: '^".*\.hpp"' Priority: 2 - - Regex: '^<.*' + - Regex: '^<.*\.h>' Priority: 3 - - Regex: '.*' + - Regex: '^<.*\.hpp>' Priority: 4 + - Regex: '^<.*' + Priority: 5 + - Regex: '.*' + Priority: 6 IndentCaseLabels: true IndentWidth: 4 IndentWrappedFunctionNames: true @@ -80,12 +90,17 @@ PenaltyBreakFirstLessLess: 120 PenaltyBreakString: 1000 PenaltyExcessCharacter: 1000000 PenaltyReturnTypeOnItsOwnLine: 60 -PointerAlignment: Right ReflowComments: true SortIncludes: true +SortUsingDeclarations: true SpaceAfterCStyleCast: false +SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 SpacesInAngles: false @@ -93,7 +108,8 @@ SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false SpacesInSquareBrackets: false -Standard: Cpp11 +Standard: Latest TabWidth: 4 UseTab: Never ... + -- cgit v1.2.3