forked from hyrise/hyrise
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
120 lines (116 loc) · 4.48 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
Language: Cpp
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Regroup
IncludeCategories:
# We follow the include order of Google's style guide (https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes)
# with the addition of grouping third-party headers into (1) system headers (e.g., TBB or boost) or (2) submodule
# headers located in ./third_party/.
#
# clang-format places includes into the first group (ordered by priority) where they match. Thus, it might mix TBB
# or readline headers (both using .h) with system headers (e.g., pthread.h). Thus, before defining priority one, we
# put TBB and readline headers into category 3 (i.e., third-party system headers).
# headers.
- Regex: '^<(oneapi\/tbb\/.*|readline\/.*)>$'
Priority: 3
# C system headers as the first category (e.g., <stdlib.h>). Note: the parent/main header is implicitely priority 0.
- Regex: '^<.*\.h>'
Priority: 1
# See comment for TBB. Boost headers are not mixed with C headers but STL headers. As we cannot exclude <boost/...>
# with clang-format's Posix extended regrexes, we first check for boost headers before turning to STL headers.
- Regex: '^<(boost\/.*|pqxx\/.*)>$'
Priority: 3
# STL headers as the second category (e.g., <vector>).
- Regex: '^<.*'
Priority: 2
# This list needs to be kept up to date to order non-system third party libraries properly. If third party files are
# missed, it is not a real issue. They are simply grouped with Hyrise headers.
- Regex: '^"(magic_enum|nlohmann|lz4\.h|cxxopts\.hpp|compact_vector\.hpp|concurrentqueue\.h|lightweightsemaphore\.h|uninitialized_vector\.hpp|tsl\/sparse\_.+\.h|lz4hc\.h|zdict\.h|SQLParser\.h|benchmark\/benchmark\.h|SQLParserResult\.h|sql\/.+\.h\").*$'
Priority: 4
- Regex: '.*'
Priority: 5
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
# InsertBraces: true TODO(anyone): enable when clang15 is widely used.
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: false
SeparateDefinitionBlocks: Always
SortIncludes: CaseInsensitive
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...