From fc7251edfaf782f184030a5787fe3a88feef6083 Mon Sep 17 00:00:00 2001 From: Luca Di Sera Date: Fri, 28 Jan 2022 13:48:36 +0100 Subject: [PATCH] Update _clang_format to avoid adding a space in list-initialization The current style specification for clang-format will add a space between an identifier and an initializer_list in list-initialization. For example: ``` auto foo{bar}; ``` Would be modified to: ``` auto foo {bar}; ``` The Qt Style Guidelines (https://wiki.qt.io/Qt_Coding_Style) do not seem to dictate anything about this case, while dictating about a general use of scope-delimiting braces that, arguably, does not apply here. Following a rationale that is similar to the one in Google's C++ Style Guide (https://google.github.io/styleguide/cppguide.html#Braced_Initializer_List_Format), "SpaceBeforeCpp11BracedList" is now set to false to avoid the addition of the aforementioned space. Change-Id: Ic499994a24293a634858889352c717248b8d11e3 Reviewed-by: Paul Wicking Reviewed-by: Lars Knoll --- _clang-format | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_clang-format b/_clang-format index d4f5ffbf..547e943a 100644 --- a/_clang-format +++ b/_clang-format @@ -83,3 +83,8 @@ ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCH # Break constructor initializers before the colon and after the commas. BreakConstructorInitializers: BeforeColon + +# Avoids the addition of a space between an identifier and the +# initializer list in list-initialization. +SpaceBeforeCpp11BracedList: false +