Skip to content

Commit 3a0bf15

Browse files
authored
formatting: add formatting configuration and script (#39)
1 parent f76f0a1 commit 3a0bf15

File tree

13 files changed

+2123
-3268
lines changed

13 files changed

+2123
-3268
lines changed

.clang-format

Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -2
5+
AlignAfterOpenBracket: Align
6+
AlignArrayOfStructures: None
7+
AlignConsecutiveAssignments:
8+
Enabled: false
9+
AcrossEmptyLines: false
10+
AcrossComments: false
11+
AlignCompound: false
12+
PadOperators: true
13+
AlignConsecutiveBitFields:
14+
Enabled: false
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignCompound: false
18+
PadOperators: false
19+
AlignConsecutiveDeclarations:
20+
Enabled: false
21+
AcrossEmptyLines: false
22+
AcrossComments: false
23+
AlignCompound: false
24+
PadOperators: false
25+
AlignConsecutiveMacros:
26+
Enabled: false
27+
AcrossEmptyLines: false
28+
AcrossComments: false
29+
AlignCompound: false
30+
PadOperators: false
31+
AlignEscapedNewlines: Right
32+
AlignOperands: Align
33+
AlignTrailingComments:
34+
Kind: Always
35+
OverEmptyLines: 0
36+
AllowAllArgumentsOnNextLine: true
37+
AllowAllParametersOfDeclarationOnNextLine: true
38+
AllowShortBlocksOnASingleLine: Never
39+
AllowShortCaseLabelsOnASingleLine: false
40+
AllowShortEnumsOnASingleLine: true
41+
AllowShortFunctionsOnASingleLine: All
42+
AllowShortIfStatementsOnASingleLine: Never
43+
AllowShortLambdasOnASingleLine: All
44+
AllowShortLoopsOnASingleLine: false
45+
AlwaysBreakAfterDefinitionReturnType: None
46+
AlwaysBreakAfterReturnType: None
47+
AlwaysBreakBeforeMultilineStrings: false
48+
AlwaysBreakTemplateDeclarations: MultiLine
49+
AttributeMacros:
50+
- __capability
51+
BinPackArguments: true
52+
BinPackParameters: true
53+
BitFieldColonSpacing: Both
54+
BraceWrapping:
55+
AfterCaseLabel: false
56+
AfterClass: false
57+
AfterControlStatement: Never
58+
AfterEnum: false
59+
AfterExternBlock: false
60+
AfterFunction: false
61+
AfterNamespace: false
62+
AfterObjCDeclaration: false
63+
AfterStruct: false
64+
AfterUnion: false
65+
BeforeCatch: false
66+
BeforeElse: false
67+
BeforeLambdaBody: false
68+
BeforeWhile: false
69+
IndentBraces: false
70+
SplitEmptyFunction: true
71+
SplitEmptyRecord: true
72+
SplitEmptyNamespace: true
73+
BreakAfterAttributes: Never
74+
BreakAfterJavaFieldAnnotations: false
75+
BreakArrays: true
76+
BreakBeforeBinaryOperators: None
77+
BreakBeforeConceptDeclarations: Always
78+
BreakBeforeBraces: Attach
79+
BreakBeforeInlineASMColon: OnlyMultiline
80+
BreakBeforeTernaryOperators: true
81+
BreakConstructorInitializers: BeforeColon
82+
BreakInheritanceList: BeforeColon
83+
BreakStringLiterals: true
84+
ColumnLimit: 128
85+
CommentPragmas: '^ IWYU pragma:'
86+
CompactNamespaces: false
87+
ConstructorInitializerIndentWidth: 4
88+
ContinuationIndentWidth: 4
89+
Cpp11BracedListStyle: true
90+
DerivePointerAlignment: false
91+
DisableFormat: false
92+
EmptyLineAfterAccessModifier: Never
93+
EmptyLineBeforeAccessModifier: LogicalBlock
94+
ExperimentalAutoDetectBinPacking: false
95+
FixNamespaceComments: true
96+
ForEachMacros:
97+
- foreach
98+
- Q_FOREACH
99+
- BOOST_FOREACH
100+
IfMacros:
101+
- KJ_IF_MAYBE
102+
IncludeBlocks: Preserve
103+
IncludeCategories:
104+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
105+
Priority: 2
106+
SortPriority: 0
107+
CaseSensitive: false
108+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
109+
Priority: 3
110+
SortPriority: 0
111+
CaseSensitive: false
112+
- Regex: '.*'
113+
Priority: 1
114+
SortPriority: 0
115+
CaseSensitive: false
116+
IncludeIsMainRegex: '(Test)?$'
117+
IncludeIsMainSourceRegex: ''
118+
IndentAccessModifiers: false
119+
IndentCaseBlocks: false
120+
IndentCaseLabels: false
121+
IndentExternBlock: AfterExternBlock
122+
IndentGotoLabels: true
123+
IndentPPDirectives: None
124+
IndentRequiresClause: true
125+
IndentWidth: 4
126+
IndentWrappedFunctionNames: false
127+
InsertBraces: false
128+
InsertNewlineAtEOF: false
129+
InsertTrailingCommas: None
130+
IntegerLiteralSeparator:
131+
Binary: 0
132+
Decimal: 0
133+
Hex: 0
134+
JavaScriptQuotes: Leave
135+
JavaScriptWrapImports: true
136+
KeepEmptyLinesAtTheStartOfBlocks: true
137+
LambdaBodyIndentation: Signature
138+
LineEnding: DeriveLF
139+
MacroBlockBegin: ''
140+
MacroBlockEnd: ''
141+
MaxEmptyLinesToKeep: 1
142+
NamespaceIndentation: None
143+
ObjCBinPackProtocolList: Auto
144+
ObjCBlockIndentWidth: 2
145+
ObjCBreakBeforeNestedBlockParam: true
146+
ObjCSpaceAfterProperty: false
147+
ObjCSpaceBeforeProtocolList: true
148+
PackConstructorInitializers: BinPack
149+
PenaltyBreakAssignment: 2
150+
PenaltyBreakBeforeFirstCallParameter: 19
151+
PenaltyBreakComment: 300
152+
PenaltyBreakFirstLessLess: 120
153+
PenaltyBreakOpenParenthesis: 0
154+
PenaltyBreakString: 1000
155+
PenaltyBreakTemplateDeclaration: 10
156+
PenaltyExcessCharacter: 1000000
157+
PenaltyIndentedWhitespace: 0
158+
PenaltyReturnTypeOnItsOwnLine: 60
159+
PointerAlignment: Middle
160+
PPIndentWidth: -1
161+
QualifierAlignment: Leave
162+
ReferenceAlignment: Pointer
163+
ReflowComments: true
164+
RemoveBracesLLVM: false
165+
RemoveSemicolon: false
166+
RequiresClausePosition: OwnLine
167+
RequiresExpressionIndentation: OuterScope
168+
SeparateDefinitionBlocks: Leave
169+
ShortNamespaceLines: 1
170+
SortIncludes: CaseSensitive
171+
SortJavaStaticImport: Before
172+
SortUsingDeclarations: LexicographicNumeric
173+
SpaceAfterCStyleCast: false
174+
SpaceAfterLogicalNot: false
175+
SpaceAfterTemplateKeyword: true
176+
SpaceAroundPointerQualifiers: Default
177+
SpaceBeforeAssignmentOperators: true
178+
SpaceBeforeCaseColon: false
179+
SpaceBeforeCpp11BracedList: false
180+
SpaceBeforeCtorInitializerColon: true
181+
SpaceBeforeInheritanceColon: true
182+
SpaceBeforeParens: ControlStatements
183+
SpaceBeforeParensOptions:
184+
AfterControlStatements: true
185+
AfterForeachMacros: true
186+
AfterFunctionDefinitionName: false
187+
AfterFunctionDeclarationName: false
188+
AfterIfMacros: true
189+
AfterOverloadedOperator: false
190+
AfterRequiresInClause: false
191+
AfterRequiresInExpression: false
192+
BeforeNonEmptyParentheses: false
193+
SpaceBeforeRangeBasedForLoopColon: true
194+
SpaceBeforeSquareBrackets: false
195+
SpaceInEmptyBlock: false
196+
SpaceInEmptyParentheses: false
197+
SpacesBeforeTrailingComments: 1
198+
SpacesInAngles: Never
199+
SpacesInConditionalStatement: false
200+
SpacesInContainerLiterals: true
201+
SpacesInCStyleCastParentheses: false
202+
SpacesInLineCommentPrefix:
203+
Minimum: 1
204+
Maximum: -1
205+
SpacesInParentheses: false
206+
SpacesInSquareBrackets: false
207+
Standard: Latest
208+
StatementAttributeLikeMacros:
209+
- Q_EMIT
210+
StatementMacros:
211+
- Q_UNUSED
212+
- QT_REQUIRE_VERSION
213+
TabWidth: 8
214+
UseTab: Never
215+
WhitespaceSensitiveMacros:
216+
- BOOST_PP_STRINGIZE
217+
- CF_SWIFT_NAME
218+
- NS_SWIFT_NAME
219+
- PP_STRINGIZE
220+
- STRINGIZE
221+
...
222+

0 commit comments

Comments
 (0)