From 4fc4cfb7198b08da274e4f20e365baf0cbb0280b Mon Sep 17 00:00:00 2001 From: "Benoit D.-M. - oslandia" <64401067+benoitdm-oslandia@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:38:56 +0100 Subject: [PATCH] fix: add exhautive clang format options (#60594) * fix: add exhautive clang format options In order to be compliant with QtCreator, the .clang-format needs to have all the options set. * chore: remove .github/workflows/pr-run-pre-commit.yml.disabled --- .clang-format | 174 ++++++++++++++---- .../workflows/pr-run-pre-commit.yml.disabled | 22 --- 2 files changed, 135 insertions(+), 61 deletions(-) delete mode 100644 .github/workflows/pr-run-pre-commit.yml.disabled diff --git a/.clang-format b/.clang-format index 45c6af05e0a..081f70bc45e 100644 --- a/.clang-format +++ b/.clang-format @@ -1,123 +1,219 @@ -Language: Cpp +--- +Language: Cpp AccessModifierOffset: -2 AlignAfterOpenBracket: BlockIndent -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + PadOperators: false AlignEscapedNewlines: Left -AlignOperands: true -AlignTrailingComments: true +AlignOperands: Align +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: true -AllowShortBlocksOnASingleLine: false +AllowShortBlocksOnASingleLine: Never AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: true AllowShortFunctionsOnASingleLine: All -AllowShortIfStatementsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: Never AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None AlwaysBreakAfterReturnType: None AlwaysBreakBeforeMultilineStrings: false AlwaysBreakTemplateDeclarations: No BinPackArguments: true BinPackParameters: true +BitFieldColonSpacing: Both BraceWrapping: - AfterCaseLabel: true - AfterClass: true + AfterCaseLabel: true + AfterClass: true AfterControlStatement: true - AfterEnum: true + AfterEnum: true AfterExternBlock: true - AfterFunction: true - AfterNamespace: true + AfterFunction: true + AfterNamespace: true AfterObjCDeclaration: false - AfterStruct: true - AfterUnion: true - BeforeCatch: true - BeforeElse: true - IndentBraces: false + AfterStruct: true + AfterUnion: true + BeforeCatch: true + BeforeElse: true + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false SplitEmptyFunction: false SplitEmptyRecord: false SplitEmptyNamespace: false +BreakAfterAttributes: Never +BreakAfterJavaFieldAnnotations: false +BreakArrays: true BreakBeforeBinaryOperators: All +BreakBeforeConceptDeclarations: Always BreakBeforeBraces: Custom BreakBeforeInheritanceComma: false BreakBeforeTernaryOperators: true BreakConstructorInitializers: BeforeComma -BreakAfterJavaFieldAnnotations: false BreakStringLiterals: true ColumnLimit: 0 -CommentPragmas: '^ IWYU pragma:' +CommentPragmas: "^ IWYU pragma:" CompactNamespaces: false ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 Cpp11BracedListStyle: true DerivePointerAlignment: false -DisableFormat: false +DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true IncludeCategories: - - Regex: '^