From 3e53a5804a83c7d39dd383208a132197e25ee450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Thu, 6 Feb 2025 17:14:29 +0100 Subject: [PATCH] Add support for clang_format options version 18 (#2064) --- .clang-format_18 | 135 +++++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 7 ++- 2 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 .clang-format_18 diff --git a/.clang-format_18 b/.clang-format_18 new file mode 100644 index 0000000..2976ed0 --- /dev/null +++ b/.clang-format_18 @@ -0,0 +1,135 @@ +--- +AccessModifierOffset : -2 +AlignAfterOpenBracket : Align +AlignArrayOfStructures : None +AlignConsecutiveAssignments : Consecutive +AlignConsecutiveBitFields : Consecutive +AlignConsecutiveShortCaseStatements : + Enabled : true + AcrossEmptyLines : false + AcrossComments : true + AlignCaseColons : true +AlignConsecutiveDeclarations : Consecutive +AlignConsecutiveMacros : Consecutive +AlignEscapedNewlines : Left +AlignOperands : AlignAfterOperator +AlignTrailingComments : + Kind : Always + OverEmptyLines : 0 +AllowAllArgumentsOnNextLine : true +AllowAllParametersOfDeclarationOnNextLine : true +AllowBreakBeforeNoexceptSpecifier : Always +AllowShortBlocksOnASingleLine : Empty +AllowShortCaseLabelsOnASingleLine : true +AllowShortCompoundRequirementOnASingleLine : true +AllowShortEnumsOnASingleLine : true +AllowShortFunctionsOnASingleLine : Empty +AllowShortIfStatementsOnASingleLine : Never +AllowShortLambdasOnASingleLine : All +AllowShortLoopsOnASingleLine : false +AlwaysBreakAfterReturnType : None +AlwaysBreakBeforeMultilineStrings : true +AlwaysBreakTemplateDeclarations : Yes +BinPackArguments : false +BinPackParameters : false +BitFieldColonSpacing : Both +BracedInitializerIndentWidth : 2 +BraceWrapping : + AfterCaseLabel : true + AfterClass : true + AfterControlStatement : Always + AfterEnum : true + AfterFunction : true + AfterNamespace : true + AfterStruct : true + AfterUnion : true + AfterExternBlock : true + BeforeCatch : true + BeforeElse : true + BeforeLambdaBody : true + BeforeWhile : false + IndentBraces : false + SplitEmptyFunction : true + SplitEmptyRecord : true + SplitEmptyNamespace : true +BreakAdjacentStringLiterals : false +BreakAfterAttributes: Leave +BreakBeforeBinaryOperators : None +BreakBeforeBraces : Custom +BreakBeforeConceptDeclarations : Always +BreakBeforeInlineASMColon : OnlyMultiline +BreakBeforeTernaryOperators : true +BreakConstructorInitializers : BeforeComma +BreakInheritanceList : BeforeComma +BreakStringLiterals : false +ColumnLimit : 160 +CompactNamespaces : false +ConstructorInitializerIndentWidth : 2 +ContinuationIndentWidth : 2 +Cpp11BracedListStyle : false +EmptyLineAfterAccessModifier : Never +EmptyLineBeforeAccessModifier : LogicalBlock +FixNamespaceComments : true +IncludeBlocks : Regroup +IndentAccessModifiers : false +IndentCaseBlocks : true +IndentCaseLabels : true +IndentExternBlock : true +IndentPPDirectives : AfterHash +IndentRequiresClause : false +IndentWidth : 2 +IndentWrappedFunctionNames : true +InsertBraces : false +InsertNewlineAtEOF : true +IntegerLiteralSeparator : + Binary : 4 + Decimal : 0 + Hex : 2 + HexMinDigits : 6 +KeepEmptyLinesAtTheStartOfBlocks : false +LambdaBodyIndentation : Signature +MaxEmptyLinesToKeep : 1 +NamespaceIndentation : All +PackConstructorInitializers : NextLine +PPIndentWidth : -1 +PointerAlignment : Middle +ReferenceAlignment : Pointer +ReflowComments : true +RemoveBracesLLVM : false +RequiresClausePosition : OwnLine +RequiresExpressionIndentation : Keyword +SeparateDefinitionBlocks : Always +ShortNamespaceLines : 0 +SortIncludes : true +SortUsingDeclarations : true +SpaceAfterCStyleCast : false +SpaceAfterLogicalNot : false +SpaceAfterTemplateKeyword : true +SpaceAroundPointerQualifiers : Both +SpaceBeforeAssignmentOperators : true +SpaceBeforeCaseColon : false +SpaceBeforeCpp11BracedList : false +SpaceBeforeCtorInitializerColon : true +SpaceBeforeInheritanceColon : true +SpaceBeforeParens : ControlStatements +SpaceBeforeRangeBasedForLoopColon : true +SpaceBeforeSquareBrackets : false +SpaceInEmptyBlock : false +SpaceInEmptyParentheses : false +SpacesBeforeTrailingComments : 2 +SpacesInAngles : false +SpacesInContainerLiterals : false +SpacesInLineCommentPrefix : + Minimum : 1 + Maximum : -1 +SpacesInParens : Custom +SpacesInParensOptions : + InConditionalStatements : true + InCStyleCasts : false + InEmptyParentheses : false + Other : true +SpacesInSquareBrackets : false +Standard : Latest +UseCRLF : true +UseTab : Never +... diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a9e653..8fda2a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,9 +103,12 @@ if ( VULKAN_HPP_GENERATOR_BUILD ) elseif( clangFormatVersion VERSION_LESS 17.0.0 ) message( STATUS " Using .clang-format version 16." ) file( READ ".clang-format_16" clangFormat ) - else() - message(STATUS " Using .clang-format version 17." ) + elseif( clangFormatVersion VERSION_LESS 18.0.0 ) + message( STATUS " Using .clang-format version 17." ) file( READ ".clang-format_17" clangFormat ) + else() + message(STATUS " Using .clang-format version 18." ) + file( READ ".clang-format_18" clangFormat ) endif() file( WRITE ".clang-format" ${clangFormat} ) endif()