-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
165 lines (159 loc) · 4.34 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
---
# DisableFormat: true
Language: Cpp
Standard: Latest
BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left
AlignConsecutiveAssignments: true
AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
# AlignConsecutiveShortCaseStatements: # available since clang 18
# Enabled: true
# AcrossEmptyLines: true
# AcrossComments: true
# AlignCaseColons: true
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: true
AcrossComments: true
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments:
Kind: Always
OverEmptyLines: 2
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
#AllowShortCompoundRequirementOnASingleLine: true # available since clang 18
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: All
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: AfterColon
ColumnLimit: 100
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
EmptyLineBeforeAccessModifier: Always
EmptyLineAfterAccessModifier: Never
FixNamespaceComments: false
LambdaBodyIndentation: Signature
LineEnding: LF
# These only work for quoted includes, for some unknown reason
# IncludeIsMainRegex: '$?'
# IncludeIsMainSourceRegex: '?$'
IncludeBlocks: Regroup
IncludeCategories:
# NOTE: Hyphen `-` must be last in bracket to work
# Lowercase-prefixed headers in <> with one /
- Regex: '^<[a-z0-9_-]+[\/][a-z0-9_\.-]+hxx>$'
Priority: 1
SortPriority: 1
CaseSensitive: true
# Lowercase-prefixed headers in <> with two or more /
- Regex: '^<[a-z0-9_-]+[\/][a-z0-9_-]+[\/][a-z0-9_\/\.-]+hxx>$'
Priority: 1
SortPriority: 2
CaseSensitive: true
# Standard headers in <>
- Regex: '^<[a-z0-9_-]+>$'
Priority: 3
CaseSensitive: true
# Anycase-prefixed headers in <> with one or more /
- Regex: '^<[a-z0-9_-]+[\/][a-z0-9_\.-]+>$'
Priority: 4
SortPriority: 4
CaseSensitive: false
# Anycase-prefixed headers in <> with two or more /
- Regex: '^<[a-z0-9_-]+[\/][a-z0-9_-]+[\/][a-z0-9_\/\.-]+>$'
Priority: 4
SortPriority: 5
CaseSensitive: false
# Rest
- Regex: '^.*$'
Priority: 6
CaseSensitive: false
IndentCaseLabels: true
IndentPPDirectives: BeforeHash
IndentRequiresClause: True
IndentWidth: 2
InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PackConstructorInitializers: Never
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 100
PenaltyBreakComment: 100
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 10000
PenaltyReturnTypeOnItsOwnLine: 1000000000
PointerAlignment: Left
PPIndentWidth: -1
QualifierAlignment: Custom
QualifierOrder:
- friend
- inline
- static
- constexpr
- type
- const
- volatile
ReferenceAlignment: Pointer
ReflowComments: true
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: Keyword
SeparateDefinitionBlocks: Always
SortIncludes: CaseSensitive
SortUsingDeclarations: Lexicographic
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterControlStatements: True
AfterRequiresInClause: True
AfterRequiresInExpression: True
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
TabWidth: 2
UseTab: Never
...