Skip to content

Commit 71f14e0

Browse files
committed
feature(clang-format) Adds clang-format config file. (#493)
1 parent e477aa7 commit 71f14e0

File tree

2 files changed

+283
-2
lines changed

2 files changed

+283
-2
lines changed

.clang-format

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

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
!.gitattributes
66
!.github
77
!.gitmodules
8+
!.clang-format
89

910
*.user
1011
*.ncb
@@ -44,7 +45,6 @@ CPackSourceConfig.cmake
4445
thumbs.db
4546
/CMakeUserPresets.json
4647
/.cache
47-
.clang-format
4848
/.vscode
4949
/Dependencies/MaxSDK/maxsdk
5050

@@ -57,4 +57,4 @@ cmake-build-*/
5757
## Ninja
5858
.ninja_deps
5959
.ninja_log
60-
build.ninja
60+
build.ninja

0 commit comments

Comments
 (0)