From 653932bb30a4c3111dc1f99a641a011f10f21edd Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Wed, 23 Jun 2021 18:59:51 +0200 Subject: Require ClangFormat 10 or newer, if used --- .clang-format | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) (limited to '.clang-format') diff --git a/.clang-format b/.clang-format index 4510d46e..72b67488 100644 --- a/.clang-format +++ b/.clang-format @@ -23,16 +23,17 @@ AlignAfterOpenBracket: Align #AlignConsecutiveAssignments: false #AlignConsecutiveDeclarations: false AlignEscapedNewlines: Left -AlignOperands: true +AlignOperands: true # 'Align' since ClangFormat 11 #AlignTrailingComments: false #AllowAllArgumentsOnNextLine: true #AllowAllConstructorInitializersOnNextLine: true #AllowAllParametersOfDeclarationOnNextLine: true -#AllowShortBlocksOnASingleLine: false # 'Empty' since ClangFormat 10 +#AllowShortEnumsOnASingleLine: true +#AllowShortBlocksOnASingleLine: Empty #AllowShortCaseLabelsOnASingleLine: false #AllowShortFunctionsOnASingleLine: All #AllowShortLambdasOnASingleLine: All -#AllowShortIfStatementsOnASingleLine: false # 'Never' since ClangFormat 10 +#AllowShortIfStatementsOnASingleLine: Never #AllowShortLoopsOnASingleLine: false #AlwaysBreakAfterDefinitionReturnType: None # deprecated #AlwaysBreakAfterReturnType: None @@ -43,7 +44,7 @@ AlwaysBreakTemplateDeclarations: Yes BraceWrapping: AfterCaseLabel: false AfterClass: false - AfterControlStatement: false + AfterControlStatement: MultiLine AfterEnum: false AfterFunction: true AfterNamespace: false @@ -61,22 +62,18 @@ BreakBeforeBraces: Custom #BreakBeforeInheritanceComma: false #BreakInheritanceList: BeforeColon #BreakBeforeTernaryOperators: true -#BreakConstructorInitializersBeforeComma: false +#BreakConstructorInitializersBeforeComma: false # deprecated? #BreakConstructorInitializers: BeforeComma #BreakStringLiterals: true ColumnLimit: 80 -CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: true +#CompactNamespaces: false +#ConstructorInitializerAllOnOneLineOrOnePerLine: false #ConstructorInitializerIndentWidth: 4 #ContinuationIndentWidth: 4 Cpp11BracedListStyle: false #DeriveLineEnding: true #DerivePointerAlignment: false FixNamespaceComments: true -ForEachMacros: - - foreach - - Q_FOREACH - - forever IncludeBlocks: Regroup IncludeCategories: - Regex: '^ Date: Wed, 28 Jul 2021 15:08:05 +0200 Subject: .clang-format: revert BraceWrapping.AfterControlStatement It triggers a bug in libformat that prevents AllowShortFunctionsOnASingleLine to do its job: https://bugs.llvm.org/show_bug.cgi?id=47936 --- .clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.clang-format') diff --git a/.clang-format b/.clang-format index 72b67488..3eafee44 100644 --- a/.clang-format +++ b/.clang-format @@ -44,7 +44,7 @@ AlwaysBreakTemplateDeclarations: Yes BraceWrapping: AfterCaseLabel: false AfterClass: false - AfterControlStatement: MultiLine + AfterControlStatement: Never # Switch to MultiLine, once https://bugs.llvm.org/show_bug.cgi?id=47936 is fixed AfterEnum: false AfterFunction: true AfterNamespace: false -- cgit v1.2.3 From 42f20f827565a2bdd9e1373b7ee2c408991b9d44 Mon Sep 17 00:00:00 2001 From: Alexey Rusakov Date: Fri, 30 Jul 2021 08:07:59 +0200 Subject: .clang-format: add DEFINE_EVENT_TYPEID to StatementMacros --- .clang-format | 1 + 1 file changed, 1 insertion(+) (limited to '.clang-format') diff --git a/.clang-format b/.clang-format index 3eafee44..6e13223e 100644 --- a/.clang-format +++ b/.clang-format @@ -133,6 +133,7 @@ Standard: c++17 StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION + - DEFINE_EVENT_TYPEID TabWidth: 4 #UseCRLF: false #UseTab: Never -- cgit v1.2.3