diff options
Diffstat (limited to '.clang-format')
-rw-r--r-- | .clang-format | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/.clang-format b/.clang-format index 3399f428c..e7f5352cc 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,5 @@ # Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com> -# -# You may use this file under the terms of the 3-clause BSD license. -# See the file LICENSE from this package for details. +# SPDX-License-Identifier: BSD-3-Clause # This is the clang-format configuration style to be used by Qt, # based on the rules from https://wiki.qt.io/Qt_Coding_Style and @@ -11,7 +9,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 +18,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 @@ -60,7 +59,7 @@ ContinuationIndentWidth: 8 NamespaceIndentation: None # Allow indentation for preprocessing directives (if/ifdef/endif). https://reviews.llvm.org/rL312125 -IndentPPDirectives: AfterHash +# IndentPPDirectives: AfterHash - Redefined for QtWebEngine Qt Style # Horizontally align arguments after an open bracket. # The coding style does not specify the following, but this is what gives @@ -82,7 +81,11 @@ SortIncludes: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ] # Break constructor initializers before the colon and after the commas. -BreakConstructorInitializers: BeforeColon +# BreakConstructorInitializers: BeforeColon - Redefined for QtWebEngine Qt Style + +# Avoids the addition of a space between an identifier and the +# initializer list in list-initialization. +SpaceBeforeCpp11BracedList: false ################################################################################ # QtWebEngine specific changes to Qt style @@ -90,6 +93,9 @@ BreakConstructorInitializers: BeforeColon # 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|\ |