aboutsummaryrefslogtreecommitdiffstats
path: root/_clang-format
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2022-01-28 13:48:36 +0100
committerLuca Di Sera <luca.disera@qt.io>2022-02-01 12:12:42 +0000
commitfc7251edfaf782f184030a5787fe3a88feef6083 (patch)
treec96812f6ad6211caa897eaf9495bba52c9f283e3 /_clang-format
parent279841383d0cd8c852bf25415aaf2747c932710d (diff)
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 <paul.wicking@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to '_clang-format')
-rw-r--r--_clang-format5
1 files changed, 5 insertions, 0 deletions
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
+