From f3b97151f124fde95e11058bc90cb8832c2d0e17 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 30 Oct 2020 21:43:19 +0100 Subject: [PATCH] Update .clang-format.. --- .clang-format | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.clang-format b/.clang-format index d5f1315..7f27975 100644 --- a/.clang-format +++ b/.clang-format @@ -8,25 +8,27 @@ Language: Cpp AccessModifierOffset: -4 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false +# AlignConsecutiveBitFields: false # clang-format 11 AlignConsecutiveDeclarations: false AlignConsecutiveMacros: false AlignEscapedNewlines: DontAlign -AlignOperands: true +AlignOperands: true # clang-format 11: Align AlignTrailingComments: true AllowAllArgumentsOnNextLine: false AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Empty AllowShortCaseLabelsOnASingleLine: false +# AllowShortEnumsOnASingleLine: false # clang-format 11 AllowShortFunctionsOnASingleLine: Empty AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: Inline AllowShortLoopsOnASingleLine: false AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: MultiLine -BinPackArguments: true # TODO: Not sure what I prefer. -BinPackParameters: true # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: true +BinPackParameters: true BraceWrapping: # If BreakBeforeBraces is set to Custom. AfterCaseLabel: true AfterClass: true @@ -40,6 +42,7 @@ BraceWrapping: # If BreakBeforeBraces is set to Custom. BeforeCatch: true BeforeElse: true # BeforeLambdaBody: true # clang-format 11 + # BeforeWhile: true # clang-format 11 IndentBraces: false SplitEmptyFunction: false SplitEmptyRecord: false @@ -65,9 +68,13 @@ ForEachMacros: - RANGES_FOR - Q_FOREACH - BOOST_FOREACH -IncludeBlocks: Preserve -# IndentCaseBlocks: false +IncludeBlocks: Regroup +IncludeCategories: # stdlib headers into own group. + - Regex: '^[^\.]+$' + Priority: 4 +# IndentCaseBlocks: false # clang-format 11 IndentCaseLabels: false +# IndentExternBlock: NoIndent # clang-format 11 IndentGotoLabels: false IndentPPDirectives: AfterHash IndentWidth: 4 @@ -78,8 +85,8 @@ KeepEmptyLinesAtTheStartOfBlocks: true MaxEmptyLinesToKeep: 1 NamespaceIndentation: None # NamespaceMacros: 'string' -# PenaltyBreakAssignment: 2 -# PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakAssignment: 250 +PenaltyBreakBeforeFirstCallParameter: 300 # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 # PenaltyBreakString: 1000 @@ -87,10 +94,12 @@ NamespaceIndentation: None # PenaltyExcessCharacter: 1000000 # PenaltyReturnTypeOnItsOwnLine: 60 PointerAlignment: Right +# RawStringFormats: # ReflowComments: true SortIncludes: true SortUsingDeclarations: true SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: false @@ -102,7 +111,7 @@ SpaceBeforeSquareBrackets: false SpaceInEmptyBlock: false SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 1 -SpacesInAngles: false +SpacesInAngles: false SpacesInCStyleCastParentheses: false SpacesInConditionalStatement: false SpacesInContainerLiterals: false @@ -116,5 +125,7 @@ TabWidth: 4 # TypenameMacros: # - STACK_OF # - LIST +UseCRLF: false UseTab: Never +# WhitespaceSensitiveMacros: ['string', 'string'] # clang-format 11 ...