From 68512e6702a4d6a90cd67b10341125eb9dca39de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=BC=C3=9Fenbach?= Date: Mon, 16 Jan 2023 17:38:34 +0100 Subject: [PATCH] Add options for clang-format 15. (#1480) --- .clang-format_12 | 2 + .clang-format_13 | 2 + .clang-format_14 | 2 + .clang-format_15 | 111 ++++++++++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 5 ++- vulkan/vulkan.hpp | 2 +- 6 files changed, 122 insertions(+), 2 deletions(-) create mode 100644 .clang-format_15 diff --git a/.clang-format_12 b/.clang-format_12 index 7c006d5..b177501 100644 --- a/.clang-format_12 +++ b/.clang-format_12 @@ -54,12 +54,14 @@ ConstructorInitializerAllOnOneLineOrOnePerLine : true ConstructorInitializerIndentWidth : 2 ContinuationIndentWidth : 2 Cpp11BracedListStyle : false +EmptyLineBeforeAccessModifier : LogicalBlock FixNamespaceComments : true IncludeBlocks : Regroup IndentCaseBlocks : true IndentCaseLabels : true IndentExternBlock : true IndentPPDirectives : AfterHash +IndentRequires : false IndentWidth : 2 IndentWrappedFunctionNames : true KeepEmptyLinesAtTheStartOfBlocks : false diff --git a/.clang-format_13 b/.clang-format_13 index 1ee8d1f..2e255d5 100644 --- a/.clang-format_13 +++ b/.clang-format_13 @@ -56,6 +56,7 @@ ConstructorInitializerIndentWidth : 2 ContinuationIndentWidth : 2 Cpp11BracedListStyle : false EmptyLineAfterAccessModifier : Never +EmptyLineBeforeAccessModifier : LogicalBlock FixNamespaceComments : true IncludeBlocks : Regroup IndentAccessModifiers : false @@ -63,6 +64,7 @@ IndentCaseBlocks : true IndentCaseLabels : true IndentExternBlock : true IndentPPDirectives : AfterHash +IndentRequires : false IndentWidth : 2 IndentWrappedFunctionNames : true KeepEmptyLinesAtTheStartOfBlocks : false diff --git a/.clang-format_14 b/.clang-format_14 index eb07b60..d668fde 100644 --- a/.clang-format_14 +++ b/.clang-format_14 @@ -54,6 +54,7 @@ ConstructorInitializerIndentWidth : 2 ContinuationIndentWidth : 2 Cpp11BracedListStyle : false EmptyLineAfterAccessModifier : Never +EmptyLineBeforeAccessModifier : LogicalBlock FixNamespaceComments : true IncludeBlocks : Regroup IndentAccessModifiers : false @@ -61,6 +62,7 @@ IndentCaseBlocks : true IndentCaseLabels : true IndentExternBlock : true IndentPPDirectives : AfterHash +IndentRequires : false IndentWidth : 2 IndentWrappedFunctionNames : true KeepEmptyLinesAtTheStartOfBlocks : false diff --git a/.clang-format_15 b/.clang-format_15 new file mode 100644 index 0000000..1d47831 --- /dev/null +++ b/.clang-format_15 @@ -0,0 +1,111 @@ +--- +AccessModifierOffset : -2 +AlignAfterOpenBracket : Align +AlignArrayOfStructures : None +AlignConsecutiveAssignments : Consecutive +AlignConsecutiveBitFields : Consecutive +AlignConsecutiveDeclarations : Consecutive +AlignConsecutiveMacros : Consecutive +AlignEscapedNewlines : Left +AlignOperands : AlignAfterOperator +AlignTrailingComments : true +AllowAllArgumentsOnNextLine : true +AllowAllParametersOfDeclarationOnNextLine : true +AllowShortBlocksOnASingleLine : Empty +AllowShortCaseLabelsOnASingleLine : true +AllowShortEnumsOnASingleLine : true +AllowShortFunctionsOnASingleLine : Empty +AllowShortIfStatementsOnASingleLine : Never +AllowShortLambdasOnASingleLine : All +AllowShortLoopsOnASingleLine : false +AlwaysBreakAfterReturnType : None +AlwaysBreakBeforeMultilineStrings : true +AlwaysBreakTemplateDeclarations : Yes +BinPackArguments : false +BinPackParameters : false +BitFieldColonSpacing : Both +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 +BreakBeforeBinaryOperators : None +BreakBeforeBraces : Custom +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 +KeepEmptyLinesAtTheStartOfBlocks : false +LambdaBodyIndentation : Signature +MaxEmptyLinesToKeep : 1 +NamespaceIndentation : All +PackConstructorInitializers : NextLine +PPIndentWidth : -1 +PointerAlignment : Middle +ReferenceAlignment : Pointer +ReflowComments : true +RemoveBracesLLVM : false +RequiresClausePosition : OwnLine +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 +SpacesInCStyleCastParentheses : false +SpacesInConditionalStatement : true +SpacesInContainerLiterals : false +SpacesInLineCommentPrefix : + Minimum : 1 + Maximum : -1 +SpacesInParentheses : true +SpacesInSquareBrackets : false +Standard : Latest +UseCRLF : true +UseTab : Never +... diff --git a/CMakeLists.txt b/CMakeLists.txt index a83a6d1..444bcdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,9 +55,12 @@ if(CLANG_FORMAT_EXECUTABLE) elseif ( clangFormatVersion VERSION_LESS 14.0.0) message(STATUS " Using .clang-format version 13." ) file(READ ".clang-format_13" clangFormat) - else () + elseif ( clangFormatVersion VERSION_LESS 15.0.0) message(STATUS " Using .clang-format version 14." ) file(READ ".clang-format_14" clangFormat) + else () + message(STATUS " Using .clang-format version 15." ) + file(READ ".clang-format_15" clangFormat) endif () file(WRITE ".clang-format" ${clangFormat}) endif() diff --git a/vulkan/vulkan.hpp b/vulkan/vulkan.hpp index 87ba578..f801307 100644 --- a/vulkan/vulkan.hpp +++ b/vulkan/vulkan.hpp @@ -12918,7 +12918,7 @@ namespace VULKAN_HPP_NAMESPACE # elif defined( __APPLE__ ) m_library = dlopen( "libvulkan.dylib", RTLD_NOW | RTLD_LOCAL ); # elif defined( _WIN32 ) - m_library = ::LoadLibraryA( "vulkan-1.dll" ); + m_library = ::LoadLibraryA( "vulkan-1.dll" ); # else # error unsupported platform # endif