Skip to content

Commit 1b2c8be

Browse files
committed
Added clang-format and editorconfig
1 parent 4682cff commit 1b2c8be

File tree

5 files changed

+9128
-55731
lines changed

5 files changed

+9128
-55731
lines changed

.clang-format

Lines changed: 299 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,299 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignArrayOfStructures: None
6+
AlignConsecutiveAssignments:
7+
Enabled: false
8+
AcrossEmptyLines: false
9+
AcrossComments: false
10+
AlignCompound: false
11+
AlignFunctionDeclarations: false
12+
AlignFunctionPointers: false
13+
PadOperators: true
14+
AlignConsecutiveBitFields:
15+
Enabled: false
16+
AcrossEmptyLines: false
17+
AcrossComments: false
18+
AlignCompound: false
19+
AlignFunctionDeclarations: false
20+
AlignFunctionPointers: false
21+
PadOperators: false
22+
AlignConsecutiveDeclarations:
23+
Enabled: false
24+
AcrossEmptyLines: false
25+
AcrossComments: false
26+
AlignCompound: false
27+
AlignFunctionDeclarations: false
28+
AlignFunctionPointers: false
29+
PadOperators: false
30+
AlignConsecutiveMacros:
31+
Enabled: false
32+
AcrossEmptyLines: false
33+
AcrossComments: false
34+
AlignCompound: false
35+
AlignFunctionDeclarations: false
36+
AlignFunctionPointers: false
37+
PadOperators: false
38+
AlignConsecutiveShortCaseStatements:
39+
Enabled: false
40+
AcrossEmptyLines: false
41+
AcrossComments: false
42+
AlignCaseArrows: false
43+
AlignCaseColons: false
44+
AlignConsecutiveTableGenBreakingDAGArgColons:
45+
Enabled: false
46+
AcrossEmptyLines: false
47+
AcrossComments: false
48+
AlignCompound: false
49+
AlignFunctionDeclarations: false
50+
AlignFunctionPointers: false
51+
PadOperators: false
52+
AlignConsecutiveTableGenCondOperatorColons:
53+
Enabled: false
54+
AcrossEmptyLines: false
55+
AcrossComments: false
56+
AlignCompound: false
57+
AlignFunctionDeclarations: false
58+
AlignFunctionPointers: false
59+
PadOperators: false
60+
AlignConsecutiveTableGenDefinitionColons:
61+
Enabled: false
62+
AcrossEmptyLines: false
63+
AcrossComments: false
64+
AlignCompound: false
65+
AlignFunctionDeclarations: false
66+
AlignFunctionPointers: false
67+
PadOperators: false
68+
AlignEscapedNewlines: Right
69+
AlignOperands: Align
70+
AlignTrailingComments:
71+
Kind: Always
72+
OverEmptyLines: 0
73+
AllowAllArgumentsOnNextLine: true
74+
AllowAllParametersOfDeclarationOnNextLine: true
75+
AllowBreakBeforeNoexceptSpecifier: Never
76+
AllowShortBlocksOnASingleLine: Never
77+
AllowShortCaseExpressionOnASingleLine: true
78+
AllowShortCaseLabelsOnASingleLine: false
79+
AllowShortCompoundRequirementOnASingleLine: true
80+
AllowShortEnumsOnASingleLine: false
81+
AllowShortFunctionsOnASingleLine: Empty
82+
AllowShortIfStatementsOnASingleLine: Never
83+
AllowShortLambdasOnASingleLine: All
84+
AllowShortLoopsOnASingleLine: false
85+
AllowShortNamespacesOnASingleLine: false
86+
AlwaysBreakAfterDefinitionReturnType: None
87+
AlwaysBreakBeforeMultilineStrings: false
88+
AttributeMacros:
89+
- __capability
90+
- DEFINE_DATA_IN_SECTION
91+
- DEFINE_CODE_IN_SECTION
92+
BinPackArguments: true
93+
BinPackLongBracedList: true
94+
BinPackParameters: BinPack
95+
BitFieldColonSpacing: Both
96+
BracedInitializerIndentWidth: -1
97+
BraceWrapping:
98+
AfterCaseLabel: false
99+
AfterClass: false
100+
AfterControlStatement: Never
101+
AfterEnum: false
102+
AfterExternBlock: false
103+
AfterFunction: false
104+
AfterNamespace: false
105+
AfterObjCDeclaration: false
106+
AfterStruct: false
107+
AfterUnion: false
108+
BeforeCatch: false
109+
BeforeElse: false
110+
BeforeLambdaBody: false
111+
BeforeWhile: false
112+
IndentBraces: false
113+
SplitEmptyFunction: true
114+
SplitEmptyRecord: true
115+
SplitEmptyNamespace: true
116+
BreakAdjacentStringLiterals: true
117+
BreakAfterAttributes: Never
118+
BreakAfterJavaFieldAnnotations: false
119+
BreakAfterReturnType: None
120+
BreakArrays: true
121+
BreakBeforeBinaryOperators: None
122+
BreakBeforeConceptDeclarations: Always
123+
BreakBeforeBraces: Attach
124+
BreakBeforeInlineASMColon: OnlyMultiline
125+
BreakBeforeTemplateCloser: false
126+
BreakBeforeTernaryOperators: true
127+
BreakBinaryOperations: Never
128+
BreakConstructorInitializers: BeforeColon
129+
BreakFunctionDefinitionParameters: false
130+
BreakInheritanceList: BeforeColon
131+
BreakStringLiterals: true
132+
BreakTemplateDeclarations: MultiLine
133+
ColumnLimit: 0
134+
CommentPragmas: '^ IWYU pragma:'
135+
CompactNamespaces: false
136+
ConstructorInitializerIndentWidth: 4
137+
ContinuationIndentWidth: 4
138+
Cpp11BracedListStyle: false
139+
DerivePointerAlignment: false
140+
DisableFormat: false
141+
EmptyLineAfterAccessModifier: Never
142+
EmptyLineBeforeAccessModifier: LogicalBlock
143+
EnumTrailingComma: Leave
144+
ExperimentalAutoDetectBinPacking: false
145+
FixNamespaceComments: true
146+
ForEachMacros:
147+
- foreach
148+
- Q_FOREACH
149+
- BOOST_FOREACH
150+
IfMacros:
151+
- KJ_IF_MAYBE
152+
IncludeBlocks: Preserve
153+
IncludeCategories:
154+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
155+
Priority: 2
156+
SortPriority: 0
157+
CaseSensitive: false
158+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
159+
Priority: 3
160+
SortPriority: 0
161+
CaseSensitive: false
162+
- Regex: '.*'
163+
Priority: 1
164+
SortPriority: 0
165+
CaseSensitive: false
166+
IncludeIsMainRegex: '(Test)?$'
167+
IncludeIsMainSourceRegex: ''
168+
IndentAccessModifiers: false
169+
IndentCaseBlocks: false
170+
IndentCaseLabels: false
171+
IndentExportBlock: true
172+
IndentExternBlock: AfterExternBlock
173+
IndentGotoLabels: true
174+
IndentPPDirectives: None
175+
IndentRequiresClause: true
176+
IndentWidth: 4
177+
IndentWrappedFunctionNames: false
178+
InsertBraces: false
179+
InsertNewlineAtEOF: false
180+
InsertTrailingCommas: None
181+
IntegerLiteralSeparator:
182+
Binary: 0
183+
BinaryMinDigits: 0
184+
Decimal: 0
185+
DecimalMinDigits: 0
186+
Hex: 0
187+
HexMinDigits: 0
188+
JavaScriptQuotes: Leave
189+
JavaScriptWrapImports: true
190+
KeepEmptyLines:
191+
AtEndOfFile: true
192+
AtStartOfBlock: true
193+
AtStartOfFile: true
194+
KeepFormFeed: false
195+
LambdaBodyIndentation: Signature
196+
LineEnding: DeriveLF
197+
MacroBlockBegin: ''
198+
MacroBlockEnd: ''
199+
MainIncludeChar: Quote
200+
MaxEmptyLinesToKeep: 1
201+
NamespaceIndentation: All
202+
ObjCBinPackProtocolList: Auto
203+
ObjCBlockIndentWidth: 2
204+
ObjCBreakBeforeNestedBlockParam: true
205+
ObjCSpaceAfterProperty: false
206+
ObjCSpaceBeforeProtocolList: true
207+
OneLineFormatOffRegex: ''
208+
PackConstructorInitializers: BinPack
209+
PenaltyBreakAssignment: 2
210+
PenaltyBreakBeforeFirstCallParameter: 19
211+
PenaltyBreakBeforeMemberAccess: 150
212+
PenaltyBreakComment: 300
213+
PenaltyBreakFirstLessLess: 120
214+
PenaltyBreakOpenParenthesis: 0
215+
PenaltyBreakScopeResolution: 500
216+
PenaltyBreakString: 1000
217+
PenaltyBreakTemplateDeclaration: 10
218+
PenaltyExcessCharacter: 1000000
219+
PenaltyIndentedWhitespace: 0
220+
PenaltyReturnTypeOnItsOwnLine: 1000
221+
PointerAlignment: Left
222+
PPIndentWidth: -1
223+
QualifierAlignment: Leave
224+
ReferenceAlignment: Pointer
225+
ReflowComments: Never
226+
RemoveBracesLLVM: false
227+
RemoveEmptyLinesInUnwrappedLines: false
228+
RemoveParentheses: Leave
229+
RemoveSemicolon: false
230+
RequiresClausePosition: OwnLine
231+
RequiresExpressionIndentation: OuterScope
232+
SeparateDefinitionBlocks: Always
233+
ShortNamespaceLines: 1
234+
SkipMacroDefinitionBody: false
235+
SortIncludes:
236+
Enabled: false
237+
IgnoreCase: false
238+
SortJavaStaticImport: Before
239+
SortUsingDeclarations: LexicographicNumeric
240+
SpaceAfterCStyleCast: false
241+
SpaceAfterLogicalNot: false
242+
SpaceAfterOperatorKeyword: false
243+
SpaceAfterTemplateKeyword: true
244+
SpaceAroundPointerQualifiers: Default
245+
SpaceBeforeAssignmentOperators: true
246+
SpaceBeforeCaseColon: false
247+
SpaceBeforeCpp11BracedList: true
248+
SpaceBeforeCtorInitializerColon: true
249+
SpaceBeforeInheritanceColon: true
250+
SpaceBeforeJsonColon: false
251+
SpaceBeforeParens: ControlStatements
252+
SpaceBeforeParensOptions:
253+
AfterControlStatements: true
254+
AfterForeachMacros: true
255+
AfterFunctionDefinitionName: false
256+
AfterFunctionDeclarationName: false
257+
AfterIfMacros: true
258+
AfterNot: false
259+
AfterOverloadedOperator: false
260+
AfterPlacementOperator: true
261+
AfterRequiresInClause: false
262+
AfterRequiresInExpression: false
263+
BeforeNonEmptyParentheses: false
264+
SpaceBeforeRangeBasedForLoopColon: true
265+
SpaceBeforeSquareBrackets: false
266+
SpaceInEmptyBlock: false
267+
SpacesBeforeTrailingComments: 1
268+
SpacesInAngles: Never
269+
SpacesInContainerLiterals: true
270+
SpacesInLineCommentPrefix:
271+
Minimum: 1
272+
Maximum: -1
273+
SpacesInParens: Never
274+
SpacesInParensOptions:
275+
ExceptDoubleParentheses: false
276+
InCStyleCasts: false
277+
InConditionalStatements: false
278+
InEmptyParentheses: false
279+
Other: false
280+
SpacesInSquareBrackets: false
281+
Standard: Latest
282+
StatementAttributeLikeMacros:
283+
- Q_EMIT
284+
StatementMacros:
285+
- Q_UNUSED
286+
- QT_REQUIRE_VERSION
287+
TableGenBreakInsideDAGArg: DontBreak
288+
TabWidth: 4
289+
UseTab: ForIndentation
290+
VerilogBreakBetweenInstancePorts: true
291+
WhitespaceSensitiveMacros:
292+
- BOOST_PP_STRINGIZE
293+
- CF_SWIFT_NAME
294+
- NS_SWIFT_NAME
295+
- PP_STRINGIZE
296+
- STRINGIZE
297+
WrapNamespaceBodyWithEmptyLines: Leave
298+
...
299+

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
end_of_line = crlf
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.asm]
11+
indent_style = tab
12+
indent_size = 4
13+
tab_width = 4
14+
15+
[*.{c,cc,cxx,cpp,h,hpp,hxx,inl,ipp,ixx,tlh,tli}]
16+
indent_style = tab
17+
indent_size = 4
18+
tab_width = 4

0 commit comments

Comments
 (0)