Skip to content

Commit d4ac567

Browse files
committed
SERVER-23971 Update Clang-Format Options for llvm 3.8 and mongo 3.4 style update
1 parent 59a3973 commit d4ac567

File tree

1 file changed

+54
-11
lines changed

1 file changed

+54
-11
lines changed

.clang-format

+54-11
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,36 @@ Language: Cpp
22
# BasedOnStyle: Google
33
# ---
44
AccessModifierOffset: -4
5-
AlignOperands: false
6-
AlignAfterOpenBracket: true
5+
AlignAfterOpenBracket: Align
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
78
AlignEscapedNewlinesLeft: true
9+
AlignOperands: false
810
AlignTrailingComments: true
911
AllowAllParametersOfDeclarationOnNextLine: true
1012
AllowShortBlocksOnASingleLine: false
1113
AllowShortCaseLabelsOnASingleLine: false
1214
AllowShortFunctionsOnASingleLine: Empty
1315
AllowShortIfStatementsOnASingleLine: false
1416
AllowShortLoopsOnASingleLine: false
15-
AlwaysBreakAfterDefinitionReturnType: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
1619
AlwaysBreakBeforeMultilineStrings: true
1720
AlwaysBreakTemplateDeclarations: true
1821
BinPackArguments: false
1922
BinPackParameters: false
23+
BraceWrapping:
24+
AfterClass: false
25+
AfterControlStatement: false
26+
AfterEnum: false
27+
AfterFunction: false
28+
AfterNamespace: false
29+
AfterObjCDeclaration: false
30+
AfterStruct: false
31+
AfterUnion: false
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
2035
BreakBeforeBinaryOperators: None
2136
BreakBeforeBraces: Attach
2237
BreakBeforeTernaryOperators: true
@@ -31,13 +46,18 @@ DerivePointerAlignment: false
3146
DisableFormat: false
3247
ExperimentalAutoDetectBinPacking: false
3348
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
49+
IncludeCategories:
50+
- Regex: '.*'
51+
Priority: 1
3452
IndentCaseLabels: true
35-
IndentFunctionDeclarationAfterType: false
3653
IndentWidth: 4
3754
IndentWrappedFunctionNames: false
38-
KeepEmptyLinesAtTheStartOfBlocks: false
55+
KeepEmptyLinesAtTheStartOfBlocks: true
56+
MacroBlockBegin: ''
57+
MacroBlockEnd: ''
3958
MaxEmptyLinesToKeep: 2
4059
NamespaceIndentation: None
60+
ObjCBlockIndentWidth: 2
4161
ObjCSpaceAfterProperty: false
4262
ObjCSpaceBeforeProtocolList: false
4363
PenaltyBreakBeforeFirstCallParameter: 19
@@ -47,14 +67,16 @@ PenaltyBreakString: 1000
4767
PenaltyExcessCharacter: 1000000
4868
PenaltyReturnTypeOnItsOwnLine: 200
4969
PointerAlignment: Left
70+
ReflowComments: true
71+
SortIncludes: true
5072
SpaceAfterCStyleCast: false
5173
SpaceBeforeAssignmentOperators: true
5274
SpaceBeforeParens: ControlStatements
5375
SpaceInEmptyParentheses: false
5476
SpacesBeforeTrailingComments: 2
5577
SpacesInAngles: false
56-
SpacesInCStyleCastParentheses: false
5778
SpacesInContainerLiterals: true
79+
SpacesInCStyleCastParentheses: false
5880
SpacesInParentheses: false
5981
SpacesInSquareBrackets: false
6082
Standard: Cpp11
@@ -66,7 +88,9 @@ Language: JavaScript
6688
# BasedOnStyle: Google
6789
# ---
6890
AccessModifierOffset: -1
69-
AlignAfterOpenBracket: true
91+
AlignAfterOpenBracket: Align
92+
AlignConsecutiveAssignments: false
93+
AlignConsecutiveDeclarations: false
7094
AlignEscapedNewlinesLeft: true
7195
AlignOperands: false
7296
AlignTrailingComments: true
@@ -76,11 +100,24 @@ AllowShortCaseLabelsOnASingleLine: false
76100
AllowShortFunctionsOnASingleLine: None
77101
AllowShortIfStatementsOnASingleLine: false
78102
AllowShortLoopsOnASingleLine: false
79-
AlwaysBreakAfterDefinitionReturnType: false
103+
AlwaysBreakAfterDefinitionReturnType: None
104+
AlwaysBreakAfterReturnType: None
80105
AlwaysBreakBeforeMultilineStrings: true
81106
AlwaysBreakTemplateDeclarations: true
82107
BinPackArguments: false
83108
BinPackParameters: false
109+
BraceWrapping:
110+
AfterClass: false
111+
AfterControlStatement: false
112+
AfterEnum: false
113+
AfterFunction: false
114+
AfterNamespace: false
115+
AfterObjCDeclaration: false
116+
AfterStruct: false
117+
AfterUnion: false
118+
BeforeCatch: false
119+
BeforeElse: false
120+
IndentBraces: false
84121
BreakBeforeBinaryOperators: None
85122
BreakBeforeBraces: Attach
86123
BreakBeforeTernaryOperators: true
@@ -94,12 +131,16 @@ Cpp11BracedListStyle: true
94131
DerivePointerAlignment: true
95132
DisableFormat: false
96133
ExperimentalAutoDetectBinPacking: false
97-
ForEachMacros: [ ]
134+
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
135+
IncludeCategories:
136+
- Regex: '.*'
137+
Priority: 1
98138
IndentCaseLabels: true
99-
IndentFunctionDeclarationAfterType: false
100139
IndentWidth: 4
101140
IndentWrappedFunctionNames: false
102141
KeepEmptyLinesAtTheStartOfBlocks: false
142+
MacroBlockBegin: ''
143+
MacroBlockEnd: ''
103144
MaxEmptyLinesToKeep: 1
104145
NamespaceIndentation: None
105146
ObjCBlockIndentWidth: 2
@@ -112,14 +153,16 @@ PenaltyBreakString: 1000
112153
PenaltyExcessCharacter: 1000000
113154
PenaltyReturnTypeOnItsOwnLine: 200
114155
PointerAlignment: Left
156+
ReflowComments: true
157+
SortIncludes: true
115158
SpaceAfterCStyleCast: false
116159
SpaceBeforeAssignmentOperators: true
117160
SpaceBeforeParens: ControlStatements
118161
SpaceInEmptyParentheses: false
119162
SpacesBeforeTrailingComments: 2
120163
SpacesInAngles: false
121-
SpacesInCStyleCastParentheses: false
122164
SpacesInContainerLiterals: false
165+
SpacesInCStyleCastParentheses: false
123166
SpacesInParentheses: false
124167
SpacesInSquareBrackets: false
125168
Standard: Auto

0 commit comments

Comments
 (0)