Commit 231d52d6 authored by Christoph Cullmann's avatar Christoph Cullmann

import 1:1 the Qt coding style .clang-format

https://code.qt.io/cgit/qt/qt5.git/plain/_clang-format
parent 7954dcf3
......@@ -8,36 +8,28 @@
# https://wiki.qt.io/Coding_Conventions
---
# Webkit style was loosely based on the Qt style.
# Webkit style was loosely based on the Qt style
BasedOnStyle: WebKit
Standard: Cpp11
# Column width is limited to 100 in accordance with Qt Coding Style.
# https://wiki.qt.io/Qt_Coding_Style
# Note that this may be changed at some point in the future.
ColumnLimit: 100
# How much weight do extra characters after the line length limit have.
# PenaltyExcessCharacter: 4
# Indent width for line continuations.
ContinuationIndentWidth: 8
# Indent initializers by 4 spaces
ConstructorInitializerIndentWidth: 4
NamespaceIndentation: None
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true
AllowShortFunctionsOnASingleLine: Inline
# When constructor initializers do not fit on one line, put them each on a new line.
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Disable reflow of qdoc comments: indentation rules are different.
# Translation comments are also excluded.
CommentPragmas: "^!|^:"
# We want a space between the type and the star for pointer types.
PointerAlignment: Right
PointerBindsToType: false
# We use template< without space.
SpaceAfterTemplateKeyword: false
# Break constructor initializers before the colon and after the commas.
BreakConstructorInitializers: BeforeColon
# We want to break before the operators, but not before a '='.
BreakBeforeBinaryOperators: NonAssignment
......@@ -56,6 +48,27 @@ BraceWrapping:
BeforeElse: false
IndentBraces: false
# When constructor initializers do not fit on one line, put them each on a new line.
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Indent initializers by 4 spaces
ConstructorInitializerIndentWidth: 4
# Indent width for line continuations.
ContinuationIndentWidth: 8
# No indentation for namespaces.
NamespaceIndentation: None
# Horizontally align arguments after an open bracket.
# The coding style does not specify the following, but this is what gives
# results closest to the existing code.
AlignAfterOpenBracket: true
AlwaysBreakTemplateDeclarations: true
# Ideally we should also allow less short function in a single line, but
# clang-format does not handle that.
AllowShortFunctionsOnASingleLine: Inline
# The coding style specifies some include order categories, but also tells to
# separate categories with an empty line. It does not specify the order within
# the categories. Since the SortInclude feature of clang-format does not
......@@ -63,4 +76,7 @@ BraceWrapping:
SortIncludes: false
# macros for which the opening brace stays attached.
ForEachMacros: [ foreach, Q_FOREACH ]
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
# Break constructor initializers before the colon and after the commas.
BreakConstructorInitializers: BeforeColon
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment