Skip to content

Commit eacd03b

Browse files
committed
Initial .clang-format config
1 parent 7fa3f9f commit eacd03b

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed

.clang-format

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
---
2+
Language: Cpp
3+
# BasedOnStyle: LLVM
4+
AccessModifierOffset: -4
5+
AlignAfterOpenBracket: DontAlign
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlines: Right
9+
AlignOperands: false
10+
AlignTrailingComments: true
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllConstructorInitializersOnNextLine: true
13+
AllowAllParametersOfDeclarationOnNextLine: true
14+
AllowShortBlocksOnASingleLine: false
15+
AllowShortCaseLabelsOnASingleLine: false
16+
AllowShortFunctionsOnASingleLine: None
17+
AllowShortLambdasOnASingleLine: None
18+
AllowShortIfStatementsOnASingleLine: Never
19+
AllowShortLoopsOnASingleLine: false
20+
AlwaysBreakAfterDefinitionReturnType: None
21+
AlwaysBreakAfterReturnType: None
22+
AlwaysBreakBeforeMultilineStrings: false
23+
AlwaysBreakTemplateDeclarations: Yes
24+
BinPackArguments: false
25+
BinPackParameters: true
26+
BraceWrapping:
27+
AfterCaseLabel: true
28+
AfterClass: true
29+
AfterControlStatement: true
30+
AfterEnum: true
31+
AfterFunction: true
32+
AfterNamespace: false
33+
AfterObjCDeclaration: false
34+
AfterStruct: true
35+
AfterUnion: true
36+
AfterExternBlock: false
37+
BeforeCatch: true
38+
BeforeElse: true
39+
IndentBraces: false
40+
SplitEmptyFunction: true
41+
SplitEmptyRecord: true
42+
SplitEmptyNamespace: true
43+
BreakBeforeBinaryOperators: NonAssignment
44+
BreakBeforeBraces: Custom
45+
BreakInheritanceList: BeforeComma
46+
BreakBeforeTernaryOperators: true
47+
BreakConstructorInitializers: BeforeComma
48+
BreakAfterJavaFieldAnnotations: false
49+
BreakStringLiterals: true
50+
ColumnLimit: 100
51+
CommentPragmas: '^ IWYU pragma:'
52+
CompactNamespaces: false
53+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
54+
ConstructorInitializerIndentWidth: 4
55+
ContinuationIndentWidth: 4
56+
Cpp11BracedListStyle: false
57+
DerivePointerAlignment: false
58+
DisableFormat: false
59+
ExperimentalAutoDetectBinPacking: false
60+
FixNamespaceComments: true
61+
ForEachMacros:
62+
- foreach
63+
- Q_FOREACH
64+
- BOOST_FOREACH
65+
IncludeBlocks: Preserve
66+
IncludeCategories:
67+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
68+
Priority: 2
69+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
70+
Priority: 3
71+
- Regex: '.*'
72+
Priority: 1
73+
IncludeIsMainRegex: '(Test)?$'
74+
IndentCaseLabels: true
75+
IndentPPDirectives: None
76+
IndentWidth: 4
77+
IndentWrappedFunctionNames: false
78+
JavaScriptQuotes: Leave
79+
JavaScriptWrapImports: true
80+
KeepEmptyLinesAtTheStartOfBlocks: true
81+
MacroBlockBegin: ''
82+
MacroBlockEnd: ''
83+
MaxEmptyLinesToKeep: 1
84+
NamespaceIndentation: None
85+
ObjCBinPackProtocolList: Auto
86+
ObjCBlockIndentWidth: 2
87+
ObjCSpaceAfterProperty: false
88+
ObjCSpaceBeforeProtocolList: true
89+
PenaltyBreakAssignment: 0
90+
PenaltyBreakBeforeFirstCallParameter: 0
91+
PenaltyBreakComment: 300
92+
PenaltyBreakFirstLessLess: 120
93+
PenaltyBreakString: 1000
94+
PenaltyBreakTemplateDeclaration: 10
95+
PenaltyExcessCharacter: 1000000
96+
PenaltyReturnTypeOnItsOwnLine: 4
97+
PointerAlignment: Left
98+
ReflowComments: true
99+
SortIncludes: false
100+
SortUsingDeclarations: true
101+
SpaceAfterCStyleCast: false
102+
SpaceAfterLogicalNot: false
103+
SpaceAfterTemplateKeyword: true
104+
SpaceBeforeAssignmentOperators: true
105+
SpaceBeforeCpp11BracedList: true
106+
SpaceBeforeCtorInitializerColon: true
107+
SpaceBeforeInheritanceColon: true
108+
SpaceBeforeParens: ControlStatements
109+
SpaceBeforeRangeBasedForLoopColon: true
110+
SpaceInEmptyParentheses: false
111+
SpacesBeforeTrailingComments: 1
112+
SpacesInAngles: false
113+
SpacesInContainerLiterals: true
114+
SpacesInCStyleCastParentheses: false
115+
SpacesInParentheses: false
116+
SpacesInSquareBrackets: false
117+
Standard: Cpp11
118+
StatementMacros:
119+
- Q_UNUSED
120+
- QT_REQUIRE_VERSION
121+
TabWidth: 4
122+
UseTab: Always
123+
...
124+

0 commit comments

Comments
 (0)