From 788f355ad2f8c1826f5e55477249934d45d62891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 12 Apr 2022 11:07:56 +0200 Subject: [PATCH] Style: Sync clang-format template with Clang 14.0 Not using any of the new options yet so we preserve compatibility with 13.0, which is still the recommended version as 14.0 actually has a regression. --- .clang-format | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.clang-format b/.clang-format index e011f060b74..f7527b89275 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,6 @@ # Commented out parameters are those with the same value as base LLVM style. # We can uncomment them if we want to change their value, or enforce the -# chosen value in case the base style changes (last sync: Clang 13.0). +# chosen value in case the base style changes (last sync: Clang 14.0). --- ### General config, applies to all languages ### BasedOnStyle: LLVM @@ -15,7 +15,6 @@ AlignAfterOpenBracket: DontAlign AlignOperands: DontAlign AlignTrailingComments: false # AllowAllArgumentsOnNextLine: true -# AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false # AllowShortEnumsOnASingleLine: true # AllowShortBlocksOnASingleLine: Never @@ -62,8 +61,8 @@ BreakConstructorInitializers: AfterColon # BreakStringLiterals: true ColumnLimit: 0 # CommentPragmas: '^ IWYU pragma:' +# QualifierAlignment: Leave # CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 8 ContinuationIndentWidth: 8 Cpp11BracedListStyle: false @@ -73,6 +72,9 @@ Cpp11BracedListStyle: false # EmptyLineAfterAccessModifier: Never # EmptyLineBeforeAccessModifier: LogicalBlock # ExperimentalAutoDetectBinPacking: false +# PackConstructorInitializers: BinPack +ConstructorInitializerAllOnOneLineOrOnePerLine: true +# AllowAllConstructorInitializersOnNextLine: true # FixNamespaceComments: true # ForEachMacros: # - foreach @@ -112,6 +114,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false # PenaltyBreakBeforeFirstCallParameter: 19 # PenaltyBreakComment: 300 # PenaltyBreakFirstLessLess: 120 +# PenaltyBreakOpenParenthesis: 0 # PenaltyBreakString: 1000 # PenaltyBreakTemplateDeclaration: 10 # PenaltyExcessCharacter: 1000000 @@ -121,6 +124,8 @@ KeepEmptyLinesAtTheStartOfBlocks: false # PPIndentWidth: -1 # ReferenceAlignment: Pointer # ReflowComments: true +# RemoveBracesLLVM: false +# SeparateDefinitionBlocks: Leave # ShortNamespaceLines: 1 # SortIncludes: CaseSensitive # SortJavaStaticImport: Before @@ -134,15 +139,20 @@ KeepEmptyLinesAtTheStartOfBlocks: false # SpaceBeforeCtorInitializerColon: true # SpaceBeforeInheritanceColon: true # SpaceBeforeParens: ControlStatements +# SpaceBeforeParensOptions: +# AfterControlStatements: true +# AfterForeachMacros: true +# AfterFunctionDefinitionName: false +# AfterFunctionDeclarationName: false +# AfterIfMacros: true +# AfterOverloadedOperator: false +# BeforeNonEmptyParentheses: false # SpaceAroundPointerQualifiers: Default # SpaceBeforeRangeBasedForLoopColon: true -# SpaceInEmptyParentheses: false -# SpacesBeforeTrailingComments: 1 # SpaceInEmptyBlock: false # SpaceInEmptyParentheses: false # SpacesBeforeTrailingComments: 1 # SpacesInAngles: Never -# SpacesInContainerLiterals: true # SpacesInConditionalStatement: false # SpacesInContainerLiterals: true # SpacesInCStyleCastParentheses: false