diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-06-21 16:33:56 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-06-22 00:59:15 +0200 |
commit | 155dd36a56912fd4ab4b447db38073900e53fc67 (patch) | |
tree | f5ce0b7bf2ab37c448710aa68f39848dee90a2c4 /.clang-format | |
parent | fd57edbfe8014812b91b66c3d13d3e8a0aabf36e (diff) |
Update .clang-format and fix messed up style
- Make sure clang-format doesn't reformat SPDX-License-Identifier
(see https://code.qt.io/cgit/qt/qt5.git/commit/?id=6a4dab1134b10b432f69819018fef2044520e0ca )
- Fix C++ version to C++17
(see https://code.qt.io/cgit/qt/qt5.git/commit/?id=fe9efd359498dc342257908f6c9c2183e95fc05d )
- Update _clang_format to avoid adding a space in list-initialization
(see https://code.qt.io/cgit/qt/qt5.git/commit/?id=fc7251edfaf782f184030a5787fe3a88feef6083 )
- Disable indentation for preprocessing directives.
- Fix indentation of UIDelegatasManager macros and prevent formatting
them.
Pick-to: 6.4
Change-Id: Ieb59c993ee715430ebc2830828e488b9f62ec727
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to '.clang-format')
-rw-r--r-- | .clang-format | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/.clang-format b/.clang-format index 3399f428c..0d61b137a 100644 --- a/.clang-format +++ b/.clang-format @@ -11,7 +11,7 @@ # Webkit style was loosely based on the Qt style BasedOnStyle: WebKit -Standard: Cpp11 +Standard: c++17 # Column width is limited to 100 in accordance with Qt Coding Style. # https://wiki.qt.io/Qt_Coding_Style @@ -20,9 +20,10 @@ ColumnLimit: 100 # How much weight do extra characters after the line length limit have. # PenaltyExcessCharacter: 4 -# Disable reflow of qdoc comments: indentation rules are different. -# Translation comments are also excluded. -CommentPragmas: "^!|^:" +# Disable reflow of some specific comments +# qdoc comments: indentation rules are different. +# Translation comments and SPDX license identifiers are also excluded. +CommentPragmas: "^!|^:|^ SPDX-License-Identifier:" # We want a space between the type and the star for pointer types. PointerBindsToType: false @@ -84,12 +85,19 @@ 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 + ################################################################################ # QtWebEngine specific changes to Qt style # We are using BeforeComma consistently so don't change it BreakConstructorInitializers: BeforeComma +# Disable indentation for preprocessing directives. Looks confusing at includes. +IndentPPDirectives: None + # Chromium macros MacroBlockBegin: "^\ IPC_BEGIN_MESSAGE_MAP|\ |