From eab4781d2800c631c18223d84b1d4ee9462f6604 Mon Sep 17 00:00:00 2001 From: Jose Martins Date: Thu, 12 Oct 2023 20:21:42 +0100 Subject: [PATCH] update(clang-format): update clang format options After updating the used clang versions from 14 to 18, it was necessary to update the available options in .clang-format that that into account new options introduced and others deprecated in versions 15 through 18. Signed-off-by: Jose Martins --- .clang-format | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/.clang-format b/.clang-format index 812e9c5..3a4181c 100644 --- a/.clang-format +++ b/.clang-format @@ -9,9 +9,8 @@ AlignConsecutiveBitFields: None AlignConsecutiveDeclarations: None AlignEscapedNewlines: Left AlignOperands: DontAlign -AlignTrailingComments: true +AlignTrailingComments: false AllowAllArgumentsOnNextLine: false -AllowAllConstructorInitializersOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false AllowShortEnumsOnASingleLine: true AllowShortBlocksOnASingleLine: Always @@ -39,25 +38,26 @@ BraceWrapping: SplitEmptyRecord: false BreakBeforeBinaryOperators: None BreakBeforeTernaryOperators: false +BreakBeforeInlineASMColon: OnlyMultiline BreakStringLiterals: true ColumnLimit: 80 ContinuationIndentWidth: 4 -DeriveLineEnding: true DerivePointerAlignment: false DisableFormat: false ExperimentalAutoDetectBinPacking: false -ForEachMacros: - - foreach - - Q_FOREACH - - BOOST_FOREACH IncludeBlocks: Preserve IndentCaseBlocks: false IndentCaseLabels: true IndentGotoLabels: false -IndentPPDirectives: None +IndentPPDirectives: BeforeHash IndentWidth: 4 IndentWrappedFunctionNames: false +InsertBraces: true +InsertNewlineAtEOF: true +InsertTrailingCommas: None +KeepEmptyLinesAtEOF: false KeepEmptyLinesAtTheStartOfBlocks: false +LineEnding: LF MacroBlockBegin: '' MacroBlockEnd: '' MaxEmptyLinesToKeep: 1 @@ -65,12 +65,22 @@ PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 1000 PenaltyBreakComment: 10 PenaltyBreakFirstLessLess: 10 +PenaltyBreakOpenParenthesis: 5 PenaltyBreakString: 10 PenaltyBreakTemplateDeclaration: 10 -PenaltyExcessCharacter: 100 +PenaltyExcessCharacter: 50 PenaltyReturnTypeOnItsOwnLine: 100 PointerAlignment: Left +# Not using QualigierAlignment as it seems only to affect parameter lists, not +# variable declarations. May enable it if this changes in future clang-format +# versions. +# QualifierAlignment: Custom +# QualifierOrder: ['static', 'inline', 'type', 'const', 'volatile'] ReflowComments: true +RemoveBracesLLVM: false +RemoveParentheses: MultipleParentheses +RemoveSemicolon: true +SeparateDefinitionBlocks: Leave SortIncludes: false SpaceAfterCStyleCast: false SpaceAfterLogicalNot: false @@ -80,11 +90,13 @@ SpaceBeforeInheritanceColon: true SpaceBeforeParens: ControlStatements SpaceBeforeRangeBasedForLoopColon: false SpaceInEmptyBlock: true -SpaceInEmptyParentheses: false +SpacesInParens: Custom +SpacesInParensOptions: + InConditionalStatements: false + InEmptyParentheses: false + InCStyleCasts: false + Other: false SpacesBeforeTrailingComments: 1 -SpacesInConditionalStatement: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false SpacesInSquareBrackets: false SpaceBeforeSquareBrackets: false Standard: Latest @@ -92,7 +104,6 @@ StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 4 -UseCRLF: false UseTab: Never WhitespaceSensitiveMacros: - STRINGIZE