-
-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy path.clang-format
More file actions
182 lines (162 loc) · 4.91 KB
/
Copy path.clang-format
File metadata and controls
182 lines (162 loc) · 4.91 KB
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
---
# Universal Numbers Library - clang-format configuration
# Based on actual codebase style analysis
# Language
Language: Cpp
Standard: c++20
# Base style (closest match to current style)
BasedOnStyle: LLVM
# Indentation - Universal uses TABS
IndentWidth: 4
TabWidth: 4
UseTab: ForIndentation # Use tabs for indentation, spaces for alignment
ContinuationIndentWidth: 4
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: false
NamespaceIndentation: None
# Line length - scientific computing often needs wider lines
ColumnLimit: 120
# Braces - Keep on same line (current style)
BreakBeforeBraces: Attach
BraceWrapping:
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
# Spacing
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# Template and function declarations
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
ConstructorInitializerIndentWidth: 4
# Pointer and reference alignment (current style: left-aligned)
PointerAlignment: Left
ReferenceAlignment: Left
DerivePointerAlignment: false
# Includes - organize by type
SortIncludes: Never # Disabled - preserve manual include ordering
IncludeBlocks: Preserve
IncludeCategories:
# C system headers
- Regex: '^<(assert|complex|ctype|errno|fenv|float|inttypes|limits|locale|math|setjmp|signal|stdarg|stddef|stdint|stdio|stdlib|string|time|wchar|wctype)\.h>'
Priority: 1
# C++ standard library
- Regex: '^<[a-z_]+>'
Priority: 2
# Universal utility headers
- Regex: '^<universal/utility/'
Priority: 3
# Universal trait headers
- Regex: '^<universal/traits/'
Priority: 4
# Universal common headers
- Regex: '^<universal/common/'
Priority: 5
# Universal internal headers
- Regex: '^<universal/internal/'
Priority: 6
# Universal number system headers
- Regex: '^<universal/number/'
Priority: 7
# Universal numeric headers
- Regex: '^<universal/numeric/'
Priority: 8
# Universal blas headers
- Regex: '^<universal/blas/'
Priority: 9
# Universal verification headers
- Regex: '^<universal/verification/'
Priority: 10
# Other Universal headers
- Regex: '^<universal/'
Priority: 11
# Local project headers
- Regex: '^"'
Priority: 12
# Comments
ReflowComments: true
SpacesBeforeTrailingComments: 2
CommentPragmas: '^ (IWYU pragma:|NOLINT)'
# Namespaces - compact style: namespace sw { namespace universal {
CompactNamespaces: false
FixNamespaceComments: true
ShortNamespaceLines: 10
# Preprocessor
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignConsecutiveAssignments:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignConsecutiveDeclarations:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignEscapedNewlines: Right
# Function and control flow formatting
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
# Bin packing - affects template instantiations
BinPackArguments: true
BinPackParameters: true
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
# Binary operators and ternary
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
# String literals
BreakStringLiterals: true
# Empty lines
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 2 # Allow more blank lines for visual separation
# Penalties - fine-tune line breaking decisions
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
# Alignment
AlignAfterOpenBracket: Align
AlignOperands: Align
AlignTrailingComments: true
# Other
DisableFormat: false
SortUsingDeclarations: true
SpaceBeforeSquareBrackets: false
...