From f503fe586b063197eae09a083b3c7001c69ddeda Mon Sep 17 00:00:00 2001 From: xiaoyifang Date: Fri, 28 Oct 2022 10:49:27 +0800 Subject: [PATCH] add new clang format style --- .clang-format | 54 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/.clang-format b/.clang-format index a845f039..f6756c96 100644 --- a/.clang-format +++ b/.clang-format @@ -1,29 +1,65 @@ # Format Style Options - Created with Clang Power Tools --- -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: AcrossComments +AccessModifierOffset: -1 +AlignAfterOpenBracket: DontAlign +AlignConsecutiveAssignments: Consecutive AlignEscapedNewlines: Left -AlignOperands: Align +AlignOperands: DontAlign +AlignTrailingComments: false AllowAllArgumentsOnNextLine: false -AllowShortBlocksOnASingleLine: false -AllowShortFunctionsOnASingleLine: None -AllowShortIfStatementsOnASingleLine: Never +AllowShortBlocksOnASingleLine: Empty +AllowShortLambdasOnASingleLine: None +AllowShortEnumsOnASingleLine: false +AlwaysBreakBeforeMultilineStrings: true BasedOnStyle: LLVM BinPackArguments: false BinPackParameters: false +BraceWrapping: + AfterCaseLabel: false + AfterClass: true + AfterControlStatement: true + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: true + AfterExternBlock: false + BeforeCatch: false + BeforeElse: true + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: false + SplitEmptyNamespace: false + BeforeLambdaBody: false + BeforeWhile: false BreakBeforeBinaryOperators: NonAssignment -BreakBeforeBraces: Allman +BreakBeforeBraces: Custom +BreakBeforeTernaryOperators: false BreakConstructorInitializers: AfterColon +BreakStringLiterals: false ColumnLimit: 120 ConstructorInitializerAllOnOneLineOrOnePerLine: true -ConstructorInitializerIndentWidth : 2 ContinuationIndentWidth: 2 -MaxEmptyLinesToKeep: 1 +DeriveLineEnding: false +EmptyLineBeforeAccessModifier: Leave +ExperimentalAutoDetectBinPacking: true +FixNamespaceComments: false +IncludeBlocks: Regroup +IndentCaseLabels: true +IndentPPDirectives: BeforeHash +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: Inner PointerAlignment: Middle +ReflowComments: false SortIncludes: false SortUsingDeclarations: false +SpaceAfterCStyleCast: true +SpaceBeforeCtorInitializerColon: false +SpaceBeforeInheritanceColon: false SpaceBeforeParens: Never SpacesInAngles: true +SpacesInConditionalStatement: true SpacesInParentheses: true SpacesInSquareBrackets: true UseTab: Never