Skip to content

Commit dcdf46e

Browse files
authored
introduce SOFA clang-format file (#258)
1 parent 8d02e9a commit dcdf46e

File tree

1 file changed

+168
-0
lines changed

1 file changed

+168
-0
lines changed

.clang-format

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: Google
4+
AccessModifierOffset: -1
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveMacros: false
7+
AlignConsecutiveAssignments: false
8+
AlignConsecutiveDeclarations: false
9+
AlignEscapedNewlines: Left
10+
AlignOperands: true
11+
AlignTrailingComments: true
12+
AllowAllArgumentsOnNextLine: true
13+
AllowAllConstructorInitializersOnNextLine: true
14+
AllowAllParametersOfDeclarationOnNextLine: true
15+
AllowShortBlocksOnASingleLine: Never
16+
AllowShortCaseLabelsOnASingleLine: false
17+
AllowShortFunctionsOnASingleLine: All
18+
AllowShortLambdasOnASingleLine: All
19+
AllowShortIfStatementsOnASingleLine: WithoutElse
20+
AllowShortLoopsOnASingleLine: true
21+
AlwaysBreakAfterDefinitionReturnType: None
22+
AlwaysBreakAfterReturnType: None
23+
AlwaysBreakBeforeMultilineStrings: true
24+
AlwaysBreakTemplateDeclarations: Yes
25+
BinPackArguments: true
26+
BinPackParameters: true
27+
BraceWrapping:
28+
AfterCaseLabel: false
29+
AfterClass: false
30+
AfterControlStatement: false
31+
AfterEnum: false
32+
AfterFunction: false
33+
AfterNamespace: false
34+
AfterObjCDeclaration: false
35+
AfterStruct: false
36+
AfterUnion: false
37+
AfterExternBlock: false
38+
BeforeCatch: false
39+
BeforeElse: false
40+
IndentBraces: false
41+
SplitEmptyFunction: true
42+
SplitEmptyRecord: true
43+
SplitEmptyNamespace: true
44+
BreakBeforeBinaryOperators: None
45+
BreakBeforeBraces: Allman
46+
BreakBeforeInheritanceComma: false
47+
BreakInheritanceList: BeforeColon
48+
BreakBeforeTernaryOperators: true
49+
BreakConstructorInitializersBeforeComma: false
50+
BreakConstructorInitializers: BeforeColon
51+
BreakAfterJavaFieldAnnotations: false
52+
BreakStringLiterals: true
53+
ColumnLimit: 100
54+
CommentPragmas: '^ IWYU pragma:'
55+
CompactNamespaces: false
56+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
57+
ConstructorInitializerIndentWidth: 4
58+
ContinuationIndentWidth: 4
59+
Cpp11BracedListStyle: true
60+
DeriveLineEnding: true
61+
DisableFormat: false
62+
ExperimentalAutoDetectBinPacking: false
63+
FixNamespaceComments: true
64+
ForEachMacros:
65+
- foreach
66+
- Q_FOREACH
67+
- BOOST_FOREACH
68+
IncludeBlocks: Regroup
69+
IncludeCategories:
70+
- Regex: '^<ext/.*\.h>'
71+
Priority: 2
72+
SortPriority: 0
73+
- Regex: '^<.*\.h>'
74+
Priority: 1
75+
SortPriority: 0
76+
- Regex: '^<.*'
77+
Priority: 2
78+
SortPriority: 0
79+
- Regex: '.*'
80+
Priority: 3
81+
SortPriority: 0
82+
IncludeIsMainRegex: '([-_](test|unittest))?$'
83+
IncludeIsMainSourceRegex: ''
84+
IndentCaseLabels: true
85+
IndentGotoLabels: true
86+
IndentPPDirectives: None
87+
IndentWidth: 4
88+
IndentWrappedFunctionNames: false
89+
JavaScriptQuotes: Leave
90+
JavaScriptWrapImports: true
91+
KeepEmptyLinesAtTheStartOfBlocks: false
92+
MacroBlockBegin: ''
93+
MacroBlockEnd: ''
94+
MaxEmptyLinesToKeep: 1
95+
NamespaceIndentation: None
96+
ObjCBinPackProtocolList: Never
97+
ObjCBlockIndentWidth: 4
98+
ObjCSpaceAfterProperty: false
99+
ObjCSpaceBeforeProtocolList: true
100+
PenaltyBreakAssignment: 4
101+
PenaltyBreakBeforeFirstCallParameter: 1
102+
PenaltyBreakComment: 300
103+
PenaltyBreakFirstLessLess: 120
104+
PenaltyBreakString: 1000
105+
PenaltyBreakTemplateDeclaration: 10
106+
PenaltyExcessCharacter: 1000000
107+
PenaltyReturnTypeOnItsOwnLine: 200
108+
RawStringFormats:
109+
- Language: Cpp
110+
Delimiters:
111+
- cc
112+
- CC
113+
- cpp
114+
- Cpp
115+
- CPP
116+
- 'c++'
117+
- 'C++'
118+
CanonicalDelimiter: ''
119+
BasedOnStyle: google
120+
- Language: TextProto
121+
Delimiters:
122+
- pb
123+
- PB
124+
- proto
125+
- PROTO
126+
EnclosingFunctions:
127+
- EqualsProto
128+
- EquivToProto
129+
- PARSE_PARTIAL_TEXT_PROTO
130+
- PARSE_TEST_PROTO
131+
- PARSE_TEXT_PROTO
132+
- ParseTextOrDie
133+
- ParseTextProtoOrDie
134+
CanonicalDelimiter: ''
135+
BasedOnStyle: google
136+
ReflowComments: true
137+
SortIncludes: true
138+
SortUsingDeclarations: true
139+
SpaceAfterCStyleCast: false
140+
SpaceAfterLogicalNot: false
141+
SpaceAfterTemplateKeyword: true
142+
SpaceBeforeAssignmentOperators: true
143+
SpaceBeforeCpp11BracedList: false
144+
SpaceBeforeCtorInitializerColon: true
145+
SpaceBeforeInheritanceColon: true
146+
SpaceBeforeParens: ControlStatements
147+
SpaceBeforeRangeBasedForLoopColon: true
148+
SpaceInEmptyBlock: false
149+
SpaceInEmptyParentheses: false
150+
SpacesBeforeTrailingComments: 2
151+
SpacesInAngles: false
152+
SpacesInConditionalStatement: false
153+
SpacesInContainerLiterals: true
154+
SpacesInCStyleCastParentheses: false
155+
SpacesInParentheses: false
156+
SpacesInSquareBrackets: false
157+
SpaceBeforeSquareBrackets: false
158+
Standard: Auto
159+
StatementMacros:
160+
- Q_UNUSED
161+
- QT_REQUIRE_VERSION
162+
TabWidth: 8
163+
UseCRLF: false
164+
UseTab: Never
165+
DerivePointerAlignment: false
166+
PointerAlignment: Left
167+
...
168+

0 commit comments

Comments
 (0)