Skip to content

Commit ff3e690

Browse files
committed
Added .clang-format
1 parent 70315be commit ff3e690

1 file changed

Lines changed: 166 additions & 0 deletions

File tree

.clang-format

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -4 # or -4 because of tab size
5+
AlignAfterOpenBracket: Align
6+
## AlignArrayOfStructures: Right # clang 13
7+
AlignConsecutiveMacros: Consecutive
8+
AlignConsecutiveAssignments: Consecutive
9+
AlignConsecutiveBitFields: Consecutive
10+
AlignConsecutiveDeclarations: None
11+
AlignEscapedNewlines: Right
12+
AlignOperands: AlignAfterOperator
13+
AlignTrailingComments: true
14+
AllowAllArgumentsOnNextLine: false
15+
# AllowAllConstructorInitializersOnNextLine: true
16+
AllowAllParametersOfDeclarationOnNextLine: false
17+
AllowShortEnumsOnASingleLine: false
18+
AllowShortBlocksOnASingleLine: Always
19+
AllowShortCaseLabelsOnASingleLine: true
20+
AllowShortFunctionsOnASingleLine: All
21+
AllowShortLambdasOnASingleLine: All
22+
AllowShortIfStatementsOnASingleLine: WithoutElse
23+
AllowShortLoopsOnASingleLine: false
24+
# AlwaysBreakAfterDefinitionReturnType: None
25+
AlwaysBreakAfterReturnType: None
26+
AlwaysBreakBeforeMultilineStrings: false
27+
AlwaysBreakTemplateDeclarations: MultiLine
28+
# AttributeMacros: []
29+
BinPackArguments: false
30+
BinPackParameters: false
31+
BraceWrapping:
32+
AfterCaseLabel: true
33+
AfterClass: true
34+
AfterControlStatement: Always
35+
AfterEnum: true
36+
AfterFunction: true
37+
AfterNamespace: true
38+
# AfterObjCDeclaration: false
39+
AfterStruct: true
40+
AfterUnion: true
41+
AfterExternBlock: true
42+
BeforeCatch: true
43+
BeforeElse: true
44+
BeforeLambdaBody: true
45+
BeforeWhile: true
46+
IndentBraces: false
47+
SplitEmptyFunction: false
48+
SplitEmptyRecord: false
49+
SplitEmptyNamespace: false
50+
BreakBeforeBinaryOperators: None
51+
BreakBeforeConceptDeclarations: true
52+
BreakBeforeBraces: Allman
53+
# BreakBeforeInheritanceComma: false
54+
BreakInheritanceList: BeforeComma
55+
BreakBeforeTernaryOperators: true
56+
# BreakConstructorInitializersBeforeComma: false
57+
BreakConstructorInitializers: BeforeComma
58+
# BreakAfterJavaFieldAnnotations: true
59+
BreakStringLiterals: true
60+
ColumnLimit: 120
61+
CommentPragmas: '^ IWYU pragma:'
62+
CompactNamespaces: false
63+
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
64+
ConstructorInitializerIndentWidth: 4
65+
ContinuationIndentWidth: 4
66+
Cpp11BracedListStyle: false
67+
DeriveLineEnding: false
68+
DerivePointerAlignment: false
69+
DisableFormat: false
70+
EmptyLineAfterAccessModifier: Never
71+
EmptyLineBeforeAccessModifier: LogicalBlock
72+
ExperimentalAutoDetectBinPacking: false
73+
FixNamespaceComments: true
74+
ForEachMacros:
75+
- BOOST_FOREACH
76+
IfMacros: []
77+
IncludeBlocks: Regroup
78+
IncludeCategories:
79+
# Headers in <> without extension.
80+
- Regex: '<([A-Za-z0-9\Q/-_\E])+>'
81+
Priority: 4
82+
# Headers in <> with extension.
83+
- Regex: '<([A-Za-z0-9.\Q/-_\E])+>'
84+
Priority: 3
85+
# Headers in "" with extension.
86+
- Regex: '"([A-Za-z0-9.\Q/-_\E])+"'
87+
Priority: 2
88+
# Headers which don't match any rule and need sorting.
89+
- Regex: '.*'
90+
Priority: 1
91+
IncludeIsMainRegex: '(Test)?$'
92+
IncludeIsMainSourceRegex: ''
93+
IndentAccessModifiers: false
94+
IndentCaseLabels: true
95+
IndentCaseBlocks: false
96+
IndentGotoLabels: false
97+
IndentPPDirectives: AfterHash
98+
IndentExternBlock: Indent
99+
IndentRequires: false
100+
IndentWidth: 4
101+
IndentWrappedFunctionNames: false
102+
# InsertTrailingCommas: None
103+
# JavaScriptQuotes: Leave
104+
# JavaScriptWrapImports: true
105+
KeepEmptyLinesAtTheStartOfBlocks: false
106+
LambdaBodyIndentation: Signature
107+
# MacroBlockBegin: ''
108+
# MacroBlockEnd: ''
109+
MaxEmptyLinesToKeep: 1
110+
NamespaceIndentation: All
111+
# ObjCBinPackProtocolList: Auto
112+
# ObjCBlockIndentWidth: 2
113+
# ObjCBreakBeforeNestedBlockParam: true
114+
# ObjCSpaceAfterProperty: false
115+
# ObjCSpaceBeforeProtocolList: true
116+
PenaltyBreakAssignment: 2
117+
PenaltyBreakBeforeFirstCallParameter: 19
118+
PenaltyBreakComment: 300
119+
PenaltyBreakFirstLessLess: 120
120+
PenaltyBreakString: 1000
121+
PenaltyBreakTemplateDeclaration: 10
122+
PenaltyExcessCharacter: 1000000
123+
PenaltyReturnTypeOnItsOwnLine: 60
124+
PenaltyIndentedWhitespace: 0
125+
PointerAlignment: Left
126+
PPIndentWidth: -1
127+
ReferenceAlignment: Pointer
128+
ReflowComments: true
129+
ShortNamespaceLines: 0
130+
SortIncludes: CaseSensitive
131+
# SortJavaStaticImport: Before
132+
SortUsingDeclarations: true
133+
SpaceAfterCStyleCast: false
134+
SpaceAfterLogicalNot: false
135+
SpaceAfterTemplateKeyword: false
136+
SpaceBeforeAssignmentOperators: true
137+
SpaceBeforeCaseColon: false
138+
SpaceBeforeCpp11BracedList: false
139+
SpaceBeforeCtorInitializerColon: true
140+
SpaceBeforeInheritanceColon: true
141+
SpaceBeforeParens: ControlStatements
142+
SpaceAroundPointerQualifiers: Default
143+
SpaceBeforeRangeBasedForLoopColon: true
144+
SpaceInEmptyBlock: false
145+
SpaceInEmptyParentheses: false
146+
SpacesBeforeTrailingComments: 1
147+
SpacesInAngles: Never
148+
SpacesInConditionalStatement: false
149+
SpacesInContainerLiterals: true
150+
SpacesInCStyleCastParentheses: false
151+
SpacesInLineCommentPrefix:
152+
Minimum: 1
153+
Maximum: -1
154+
SpacesInParentheses: false
155+
SpacesInSquareBrackets: false
156+
SpaceBeforeSquareBrackets: false
157+
BitFieldColonSpacing: Both
158+
Standard: c++17
159+
StatementAttributeLikeMacros: []
160+
StatementMacros: []
161+
TabWidth: 4
162+
UseCRLF: false
163+
UseTab: Never
164+
WhitespaceSensitiveMacros: []
165+
...
166+

0 commit comments

Comments
 (0)