Changeset View
Changeset View
Standalone View
Standalone View
.clang-format
- This file was added.
1 | --- | ||||
---|---|---|---|---|---|
2 | BasedOnStyle: WebKit | ||||
3 | | ||||
4 | # Use features of C++11, C++14 and C++1z. | ||||
5 | Language: Cpp | ||||
6 | Standard: Cpp11 | ||||
7 | | ||||
8 | # Align pointer to the right. | ||||
9 | PointerAlignment: Right | ||||
10 | | ||||
11 | # As a base rule, the left curly brace goes on the same line as the start of the | ||||
12 | # statement, except function implementations, classes, structs, and namespace | ||||
13 | # declarations. | ||||
14 | BreakBeforeBraces: Custom | ||||
15 | BraceWrapping: | ||||
16 | AfterClass: true | ||||
17 | AfterControlStatement: false | ||||
18 | AfterEnum: false | ||||
19 | AfterFunction: true | ||||
20 | AfterNamespace: true | ||||
21 | AfterObjCDeclaration: false | ||||
22 | AfterStruct: true | ||||
23 | AfterUnion: false | ||||
24 | AfterExternBlock: false | ||||
25 | BeforeCatch: false | ||||
26 | BeforeElse: false | ||||
27 | IndentBraces: false | ||||
28 | SplitEmptyFunction: true | ||||
29 | SplitEmptyRecord: true | ||||
30 | SplitEmptyNamespace: true | ||||
31 | | ||||
32 | # Macros that should be interpreted as foreach loops instead of as function calls. | ||||
33 | ForEachMacros: | ||||
34 | - foreach | ||||
35 | - Q_FOREACH | ||||
36 | - BOOST_FOREACH | ||||
37 | - forever | ||||
38 | - Q_FOREVER | ||||
39 | - QBENCHMARK | ||||
40 | - QBENCHMARK_ONCE | ||||
41 | | ||||
42 | # Each include section has to be sorted. | ||||
43 | SortIncludes: true | ||||
44 | | ||||
45 | # Case labels are on the same column as the switch. | ||||
46 | IndentCaseLabels: false | ||||
47 | | ||||
48 | # Don't indent in namespaces. | ||||
49 | NamespaceIndentation: None | ||||
50 | | ||||
51 | # The maximum number of consecutive empty lines to keep. | ||||
52 | MaxEmptyLinesToKeep: 1 | ||||
53 | | ||||
54 | # Break before operators that aren’t assignments. | ||||
55 | BreakBeforeBinaryOperators: NonAssignment | ||||
56 | | ||||
57 | # Sort each include block separately. We don't use Regroup option because | ||||
58 | # it's a bit too aggressive. It's up to developers to lay out include blocks | ||||
59 | # in the correct order. | ||||
60 | IncludeBlocks: Preserve | ||||
61 | | ||||
62 | # Frameworks includes go before Qt includes. | ||||
63 | IncludeCategories: | ||||
64 | - Regex: '^<K.*' | ||||
65 | Priority: 2 | ||||
66 | - Regex: '^<Q.*' | ||||
67 | Priority: 3 | ||||
68 | - Regex: '<[[:alnum:].]+>' | ||||
69 | Priority: 4 | ||||
70 | - Regex: '.*' | ||||
71 | Priority: 1 | ||||
72 | | ||||
73 | # No empty lines at the start of blocks. | ||||
74 | KeepEmptyLinesAtTheStartOfBlocks: false |