-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.clang-format
171 lines (171 loc) · 4.58 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
AccessModifierOffset: -4
AlignAfterOpenBracket: BlockIndent
AlignArrayOfStructures: None
AlignConsecutiveAssignments: None # maybe change this?
AlignConsecutiveBitFields: Consecutive
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros: Consecutive
# clang 17
#AlignConsecutiveShortCaseStatements:
# Enabled: true
# AcrossEmptyLines: false
# AcrossComments: false
# AlignCaseArrows: false
# AlignCaseColons: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: Always
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
# clang 18
#AllowBreakBeforeNoexceptSpecifier: Always
AllowShortBlocksOnASingleLine: Empty
# clang 19
#AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
# clang 19
#AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: false
# we probably do not use this
#AttributeMacros:
BinPackArguments: false
#BinPackParameters: OnePerLine
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
#BracedInitializerIndentWidth:
# clang 18
#BreakAdjacentStringLiterals: false
BreakAfterAttributes: Leave
# clang 19
#BreakAfterReturnType: Automatic
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeConceptDeclarations: Never
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: true
# clang 20
#BreakBinaryOperations: RespectPrecedence
BreakConstructorInitializers: AfterColon
# clang 19
#BreakFunctionDefinitionParameters: false
BreakInheritanceList: AfterColon
BreakStringLiterals: false
#BreakTemplateDeclarations: Yes
ColumnLimit: 120
# do not really need the following
#CommentPragmas:
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
FixNamespaceComments: true
# do not need the following two
#ForEachMacros
#IfMacros
IncludeBlocks: Regroup
# do not need these either
#IncludeCategories
#IncludeIsMainRegex
#IncludeIsMainSourceRegex
IndentAccessModifiers: false
IndentCaseBlocks: true
IndentCaseLabels: false
IndentExternBlock: NoIndent
IndentPPDirectives: None
IndentRequiresClause: false
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: true
# clang 19
#KeepEmptyLines:
# AtEndOfFile: false
# AtStartOfBlock: false
# AtStartOfFile: false
LambdaBodyIndentation: Signature
LineEnding: LF
Language: Cpp
# do not need these three
#MacroBlockBegin
#MacroBlockEnd
#Macros
# clang 19
#MainIncludeChar: Quote
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
# no need for this
#NamespaceMacros:
# IndentPPDirectives is disabled, so the following has no meaning
#PPIndentWidth:
PackConstructorInitializers: NextLine
# we do not set any of the Penalty* manually
PointerAlignment: Right
# do not manually set these two
#QualifierOrder:
#RawStringFormats:
ReferenceAlignment: Right
ReflowComments: true
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave # perhaps change this in the future
ShortNamespaceLines: 1
# clang 18
#SkipMacroDefinitionBody: false
SortIncludes: CaseInsensitive
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Both
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: true
SpacesBeforeTrailingComments: 4
SpacesInAngles: Never
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: 1
SpacesInSquareBrackets: false
Standard: Latest
# do not need these
#StatementAttributeLikeMacros
#StatementMacros
#TableGenBreakInsideDAGArg
#TableGenBreakingDAGArgOperators
TabWidth: 4
#TypeNames
#TypenameMacros
UseTab: Never
#WhitespaceSensitiveMacros