From 236bd0eb96e316d9a702acef83e9769268f334e9 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Fri, 4 Jun 2021 14:46:00 +0200 Subject: [PATCH] CI: adjust clang-formatting - duplicate the file to .base - drop 10-and-later setting that was commented out - specific setting for lambda-formatting (this seems to be the default) --- .clang-format | 2 +- .clang-format.base | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .clang-format.base diff --git a/.clang-format b/.clang-format index aa4aa0e2a..2cd8d678a 100644 --- a/.clang-format +++ b/.clang-format @@ -8,6 +8,7 @@ AlignEscapedNewlines: DontAlign AllowAllParametersOfDeclarationOnNextLine: "false" AllowShortFunctionsOnASingleLine: Inline AllowShortIfStatementsOnASingleLine: "false" +AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: "false" AlwaysBreakAfterReturnType: TopLevelDefinitions AlwaysBreakTemplateDeclarations: Yes @@ -28,7 +29,6 @@ ReflowComments: "false" SortIncludes: "true" SpaceAfterCStyleCast: "false" SpacesBeforeTrailingComments: "2" -# SpaceInEmptyBlock: "true" SpacesInAngles: "true" SpacesInParentheses: "true" SpacesInSquareBrackets: "true" diff --git a/.clang-format.base b/.clang-format.base new file mode 100644 index 000000000..2cd8d678a --- /dev/null +++ b/.clang-format.base @@ -0,0 +1,35 @@ +# SPDX-FileCopyrightText: no +# SPDX-License-Identifier: CC0-1.0 +--- +BasedOnStyle: WebKit + +AlignAfterOpenBracket: Align +AlignEscapedNewlines: DontAlign +AllowAllParametersOfDeclarationOnNextLine: "false" +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: "false" +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: "false" +AlwaysBreakAfterReturnType: TopLevelDefinitions +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: "false" +BinPackParameters: "false" +BreakBeforeBraces: Allman +BreakBeforeTernaryOperators: "true" +BreakConstructorInitializers: BeforeComma +ColumnLimit: 120 +Cpp11BracedListStyle: "false" +FixNamespaceComments: "true" +IncludeBlocks: Preserve +IndentWidth: "4" +MaxEmptyLinesToKeep: "2" +NamespaceIndentation: None +PointerAlignment: Left +ReflowComments: "false" +SortIncludes: "true" +SpaceAfterCStyleCast: "false" +SpacesBeforeTrailingComments: "2" +SpacesInAngles: "true" +SpacesInParentheses: "true" +SpacesInSquareBrackets: "true" +Standard: Cpp11