-
Notifications
You must be signed in to change notification settings - Fork 3
/
.clang-format
193 lines (165 loc) · 4.98 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
---
Language: Cpp
BasedOnStyle: ''
# Basic indentation and spacing rules:
IndentWidth: 4
ContinuationIndentWidth: 4
TabWidth: 4
UseCRLF: false
UseTab: Never
ColumnLimit: 120
MaxEmptyLinesToKeep: 3
IndentCaseLabels: true
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentWrappedFunctionNames: true
AlignConsecutiveAssignments:
# The column at which the = starts is constant among a block of definitions.
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignCompound: true
PadOperators: true
AlignConsecutiveBitFields:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveDeclarations:
# The column at which the name starts is constant among a block of declarations / definitions.
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
# configure braces and parens:
BraceWrapping:
AfterEnum: false # The { is on the same line as the struct, union or enum keyword.
AfterStruct: false # The { is on the same line as the struct, union or enum keyword.
AfterUnion: false # The { is on the same line as the struct, union or enum keyword.
AfterFunction: false # The { is on the same line as the ).
AfterCaseLabel: false
AfterControlStatement: Never
AfterExternBlock: false
BeforeElse: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
AllowShortFunctionsOnASingleLine: None # never collapse empty functions
AllowShortBlocksOnASingleLine: Never # never make single-line blocks
AllowShortIfStatementsOnASingleLine: Never # never make single-line ifs
AllowShortLoopsOnASingleLine: true # allow single-line loops
AllowShortEnumsOnASingleLine: true # allow enum { FOO = 10 };
# configure general code:
# The = has at least one space to the left and one space to the right.
SpaceBeforeAssignmentOperators: true
# configure pointers:
PointerAlignment: Right # The * is at the function name and has at least one space from the type before it.
QualifierAlignment: Right # The const is to the left of the type (unless the pointer is also a constant).
SpaceAroundPointerQualifiers: After
# include sorting:
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup
IncludeCategories:
# External headers
- Regex: '^\<('
Priority: 3
SortPriority: 0
CaseSensitive: false
# System headers
- Regex: '^\<(std.*|inttypes)'
Priority: 2
SortPriority: 0
CaseSensitive: false
# Assume project header
- Regex: '^\".*'
Priority: 1
SortPriority: 0
CaseSensitive: false
# all other options
# all arguments on one or on a separate line, use closing parens on separate line
BinPackArguments: false
BinPackParameters: false
AlignAfterOpenBracket: BlockIndent
AllowAllArgumentsOnNextLine: false
BitFieldColonSpacing: Both # int bf : 2;
AlignEscapedNewlines: Right
AllowShortCaseLabelsOnASingleLine: true # don't split up "case x: return value;"
BreakBeforeTernaryOperators: true
# default values:
# AlignArrayOfStructures: None
# AlignOperands: Align
# AlignTrailingComments: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false
# BreakBeforeBinaryOperators: None
# BreakBeforeBraces: Attach
# BreakStringLiterals: true
# CommentPragmas: '^ IWYU pragma:'
# ExperimentalAutoDetectBinPacking: false
# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# InsertBraces: false
# InsertTrailingCommas: None
# KeepEmptyLinesAtTheStartOfBlocks: true
# ReflowComments: true
# RequiresClausePosition: OwnLine
# SeparateDefinitionBlocks: Leave
# SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: false
# SpaceBeforeCaseColon: false
# SpaceBeforeParens: ControlStatements
# SpaceBeforeParensOptions:
# AfterControlStatements: true
# AfterForeachMacros: true
# AfterFunctionDefinitionName: false
# AfterFunctionDeclarationName: false
# AfterIfMacros: true
# AfterOverloadedOperator: false
# AfterRequiresInClause: false
# AfterRequiresInExpression: false
# BeforeNonEmptyParentheses: false
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: Never
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInLineCommentPrefix:
# Minimum: 1
# Maximum: -1
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# SpaceBeforeSquareBrackets: false
# Configure some special macros:
AttributeMacros:
- NORETURN
- PURE
- COLD
- HOT
- FORCEINLINE
- SECTION
WhitespaceSensitiveMacros:
- comptime_stringify
# ForEachMacros:
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH
# IfMacros:
# - KJ_IF_MAYBE
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
# StatementAttributeLikeMacros:
# - FALLTHROUGH
# MacroBlockBegin: ''
# MacroBlockEnd: ''
---