-
Notifications
You must be signed in to change notification settings - Fork 21
/
.clang-format
189 lines (178 loc) · 4.9 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
# Main style properties
Language: Cpp
Standard: Latest
BasedOnStyle: Microsoft
# Columns and Lines
ColumnLimit: 80
ReflowComments: true
TabWidth: 8
UseCRLF: false
UseTab: Never
DeriveLineEnding: true
# Breaking around braces
BreakBeforeBraces: Custom
BraceWrapping:
# Control
AfterControlStatement: MultiLine
AfterCaseLabel: true
BeforeCatch: true
BeforeElse: false
BeforeWhile: true
# Definition
AfterNamespace: false
AfterStruct: true
AfterClass: true
SplitEmptyRecord: false
AfterFunction: false
SplitEmptyFunction: false
BeforeLambdaBody: false
AfterEnum: true
SplitEmptyNamespace: true
AfterUnion: true
AfterExternBlock: true
# Extra
IndentBraces: false
# Breaking around specifiers
# Namespaces
CompactNamespaces: false
# Templates
AlwaysBreakTemplateDeclarations: Yes
BreakBeforeConceptDeclarations: true
# Classes
BreakInheritanceList: BeforeComma
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: Leave
# Functions
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: All
MaxEmptyLinesToKeep: 2
# Strings
AlwaysBreakBeforeMultilineStrings: false
BreakStringLiterals: true
# Expressions
BreakConstructorInitializers: BeforeColon
BreakBeforeBinaryOperators: All
BreakBeforeTernaryOperators: false
# Breaking single line blocks
# Control
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
# Declarations
AllowShortEnumsOnASingleLine: false
# Function
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Inline
# Expressions
AllowAllArgumentsOnNextLine: false
# Indentation
# Parameters
IndentWidth: 4
# Definitions
NamespaceIndentation: All
IndentExternBlock: NoIndent
IndentPPDirectives: AfterHash
# Classes
AccessModifierOffset: -4
IndentAccessModifiers: false
# Templates
IndentRequires: false
# Functions
IndentWrappedFunctionNames: false
LambdaBodyIndentation: OuterScope
# Control
ConstructorInitializerIndentWidth: 4
IndentCaseBlocks: false
IndentCaseLabels: false
IndentGotoLabels: true
# Expressions
ContinuationIndentWidth: 4
InsertTrailingCommas: None
KeepEmptyLinesAtTheStartOfBlocks: false
# Alignment
# Macros
AlignConsecutiveMacros: Consecutive
AttributeMacros: ['SMALL_CONSTEXPR']
# Declaration
PointerAlignment: Left
ReferenceAlignment: Pointer
DerivePointerAlignment: true
AlignConsecutiveDeclarations: None
# Namespace
ShortNamespaceLines: 0
# Brackets
AlignAfterOpenBracket: AlwaysBreak
# Expressions
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
# Spaces
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
SpacesBeforeTrailingComments: 1
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInParentheses: false
Cpp11BracedListStyle: false
# BinPack
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: After
ExperimentalAutoDetectBinPacking: true
# Penalties
PenaltyBreakAssignment: 512
PenaltyBreakBeforeFirstCallParameter: 512
PenaltyBreakComment: 512
PenaltyBreakFirstLessLess: 512
PenaltyBreakString: 512
PenaltyBreakTemplateDeclaration: 512
PenaltyExcessCharacter: 256
PenaltyIndentedWhitespace: 8
PenaltyReturnTypeOnItsOwnLine: 2
# Sorting
SortIncludes: CaseInsensitive
SortUsingDeclarations: true
IncludeBlocks: Merge
IncludeCategories:
- Regex: '^["<]small/.*/detail/prologue.hpp' # config
Priority: 1
- Regex: '^["<]small/.*/detail/epilogue.hpp' # config
Priority: 10
- Regex: '^["<]small/config/' # config
Priority: 2
- Regex: '^["<]small/detail/config.hpp' # config
Priority: 2
- Regex: '^["<]small/.*/detail/' # details
Priority: 4
- Regex: '^["<]small/detail/' # details
Priority: 4
- Regex: '^["<]small/' # internal
Priority: 3
- Regex: '^(["<](boost)/)' # external
Priority: 5
- Regex: '<[[:alnum:].]+>' # C++
Priority: 6
- Regex: '.*' # any other
Priority: 7
# Comments
FixNamespaceComments: true
CommentPragmas: '^ clang-format'