From 3409ae7e6a6e3bf4825e2d94f0d166188189597f Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 15 Jun 2024 15:45:49 +0200 Subject: [PATCH 1/2] Regenerated .clang-format with style GNU --- .clang-format | 55 +++++++++++++++++++++++++-------------------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/.clang-format b/.clang-format index d531ad9..841e62a 100644 --- a/.clang-format +++ b/.clang-format @@ -1,6 +1,5 @@ --- Language: Cpp -# BasedOnStyle: LLVM AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignArrayOfStructures: None @@ -53,8 +52,8 @@ AllowShortFunctionsOnASingleLine: All AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None +AlwaysBreakAfterDefinitionReturnType: All +AlwaysBreakAfterReturnType: AllDefinitions AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: MultiLine AttributeMacros: @@ -63,21 +62,21 @@ BinPackArguments: true BinPackParameters: true BitFieldColonSpacing: Both BraceWrapping: - AfterCaseLabel: false - AfterClass: false - AfterControlStatement: Never - AfterEnum: false - AfterExternBlock: false - AfterFunction: false - AfterNamespace: false - AfterObjCDeclaration: false - AfterStruct: false - AfterUnion: false - BeforeCatch: false - BeforeElse: false + AfterCaseLabel: true + AfterClass: true + AfterControlStatement: Always + AfterEnum: true + AfterExternBlock: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true BeforeLambdaBody: false - BeforeWhile: false - IndentBraces: false + BeforeWhile: true + IndentBraces: true SplitEmptyFunction: true SplitEmptyRecord: true SplitEmptyNamespace: true @@ -85,26 +84,26 @@ BreakAdjacentStringLiterals: true BreakAfterAttributes: Leave BreakAfterJavaFieldAnnotations: false BreakArrays: true -BreakBeforeBinaryOperators: None +BreakBeforeBinaryOperators: All BreakBeforeConceptDeclarations: Always -BreakBeforeBraces: Attach +BreakBeforeBraces: GNU BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true -ColumnLimit: 80 +ColumnLimit: 79 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 4 -Cpp11BracedListStyle: true +Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false EmptyLineAfterAccessModifier: Never EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false -FixNamespaceComments: true +FixNamespaceComments: false ForEachMacros: - foreach - Q_FOREACH @@ -186,7 +185,7 @@ RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 SkipMacroDefinitionBody: false -SortIncludes: false +SortIncludes: CaseSensitive SortJavaStaticImport: Before SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: false @@ -199,13 +198,13 @@ SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeJsonColon: false -SpaceBeforeParens: ControlStatements +SpaceBeforeParens: Always SpaceBeforeParensOptions: - AfterControlStatements: true - AfterForeachMacros: true + AfterControlStatements: false + AfterForeachMacros: false AfterFunctionDefinitionName: false AfterFunctionDeclarationName: false - AfterIfMacros: true + AfterIfMacros: false AfterOverloadedOperator: false AfterPlacementOperator: true AfterRequiresInClause: false @@ -227,7 +226,7 @@ SpacesInParensOptions: InEmptyParentheses: false Other: false SpacesInSquareBrackets: false -Standard: Latest +Standard: c++03 StatementAttributeLikeMacros: - Q_EMIT StatementMacros: From 6a4ad2779606f4ff426eb8975b31222353e424ad Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Sat, 15 Jun 2024 15:51:36 +0200 Subject: [PATCH 2/2] Tuning clang-format to match original code --- .clang-format | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.clang-format b/.clang-format index 841e62a..8342e5c 100644 --- a/.clang-format +++ b/.clang-format @@ -25,7 +25,7 @@ AlignConsecutiveDeclarations: AlignFunctionPointers: false PadOperators: false AlignConsecutiveMacros: - Enabled: false + Enabled: true AcrossEmptyLines: false AcrossComments: false AlignCompound: false @@ -92,7 +92,7 @@ BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeColon BreakInheritanceList: BeforeColon BreakStringLiterals: true -ColumnLimit: 79 +ColumnLimit: 120 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false ConstructorInitializerIndentWidth: 4 @@ -185,7 +185,7 @@ RequiresExpressionIndentation: OuterScope SeparateDefinitionBlocks: Leave ShortNamespaceLines: 1 SkipMacroDefinitionBody: false -SortIncludes: CaseSensitive +SortIncludes: false # Original: CaseInsensitive, breaks build SortJavaStaticImport: Before SortUsingDeclarations: LexicographicNumeric SpaceAfterCStyleCast: false @@ -198,7 +198,7 @@ SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true SpaceBeforeJsonColon: false -SpaceBeforeParens: Always +SpaceBeforeParens: Never SpaceBeforeParensOptions: AfterControlStatements: false AfterForeachMacros: false