| 1 |
--- |
| 2 |
# SPDX-FileCopyrightText: 2019 Christoph Cullmann <[email protected]> |
| 3 |
# SPDX-FileCopyrightText: 2019 Gernot Gebhard <[email protected]> |
| 4 |
# |
| 5 |
# SPDX-License-Identifier: MIT |
| 6 |
|
| 7 |
# Style for C++ |
| 8 |
Language: Cpp |
| 9 |
|
| 10 |
# base is WebKit coding style: https://webkit.org/code-style-guidelines/ |
| 11 |
# below are only things set that diverge from this style! |
| 12 |
BasedOnStyle: WebKit |
| 13 |
|
| 14 |
# enforce C++11 (e.g. for std::vector<std::vector<lala>> |
| 15 |
Standard: Cpp11 |
| 16 |
|
| 17 |
# 4 spaces indent |
| 18 |
TabWidth: 4 |
| 19 |
|
| 20 |
# 3 * 80 wide lines |
| 21 |
ColumnLimit: 240 |
| 22 |
|
| 23 |
# sort includes inside line separated groups |
| 24 |
SortIncludes: true |
| 25 |
|
| 26 |
# break before braces on function, namespace and class definitions. |
| 27 |
BreakBeforeBraces: Linux |
| 28 |
|
| 29 |
# CrlInstruction *a; |
| 30 |
PointerAlignment: Right |
| 31 |
|
| 32 |
# horizontally aligns arguments after an open bracket. |
| 33 |
AlignAfterOpenBracket: Align |
| 34 |
|
| 35 |
# align trailing comments |
| 36 |
AlignTrailingComments: true |
| 37 |
|
| 38 |
# don't move all parameters to new line |
| 39 |
AllowAllParametersOfDeclarationOnNextLine: false |
| 40 |
|
| 41 |
# no single line functions |
| 42 |
AllowShortFunctionsOnASingleLine: None |
| 43 |
|
| 44 |
# always break before you encounter multi line strings |
| 45 |
AlwaysBreakBeforeMultilineStrings: true |
| 46 |
|
| 47 |
# don't move arguments to own lines if they are not all on the same |
| 48 |
BinPackArguments: false |
| 49 |
|
| 50 |
# don't move parameters to own lines if they are not all on the same |
| 51 |
BinPackParameters: false |
| 52 |
|
| 53 |
# don't break binary ops |
| 54 |
BreakBeforeBinaryOperators: None |
| 55 |
|
| 56 |
# format C++11 braced lists like function calls |
| 57 |
Cpp11BracedListStyle: true |
| 58 |
|
| 59 |
# remove empty lines |
| 60 |
KeepEmptyLinesAtTheStartOfBlocks: false |
| 61 |
|
| 62 |
# no namespace indentation to keep indent level low |
| 63 |
NamespaceIndentation: None |
| 64 |
|
| 65 |
# we use template< without space. |
| 66 |
SpaceAfterTemplateKeyword: false |
| 67 |
|
| 68 |
# macros for which the opening brace stays attached. |
| 69 |
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ] |