Skip to content

Commit 537bf3f

Browse files
committed
source: update .clang-format
Add more rules and change a pair of existing.
1 parent eeb575f commit 537bf3f

File tree

1 file changed

+65
-8
lines changed

1 file changed

+65
-8
lines changed

.clang-format

Lines changed: 65 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,73 @@
11
---
22
Language: Cpp
3-
BasedOnStyle: WebKit
3+
BasedOnStyle: LLVM
44
Standard: c++17
5-
IndentWidth: 8
6-
UseTab: Always
5+
ColumnLimit: 120
76

7+
# Tabs and indents
8+
IndentWidth: 8
9+
ContinuationIndentWidth: 8
10+
ConstructorInitializerIndentWidth: 8
811
AccessModifierOffset: -8
12+
UseTab: Always
13+
TabWidth: 8
914
AlignAfterOpenBracket: Align
10-
AlwaysBreakAfterReturnType: TopLevel
11-
ColumnLimit: 120
12-
ContinuationIndentWidth: 8
15+
AlignOperands: Align
16+
AlignConsecutiveAssignments: None
17+
NamespaceIndentation: None
18+
19+
20+
# Spaces
1321
Cpp11BracedListStyle: true
14-
SpaceInEmptyBlock: false
1522
PointerAlignment: Right
16-
ReferenceAlignment: Right
23+
ReferenceAlignment: Left
24+
SpaceAfterCStyleCast: false
25+
SpaceAfterLogicalNot: false
26+
SpaceAfterTemplateKeyword: true
27+
SpaceBeforeAssignmentOperators: true
28+
SpaceBeforeCpp11BracedList: false
29+
SpaceBeforeCtorInitializerColon: true
30+
SpaceBeforeInheritanceColon: true
31+
SpaceBeforeParens: ControlStatements
32+
SpaceBeforeRangeBasedForLoopColon: false
33+
SpaceInEmptyBlock: false
34+
SpaceInEmptyParentheses: false
35+
SpacesBeforeTrailingComments: 1
36+
SpacesInAngles: false
37+
SpacesInCStyleCastParentheses: false
38+
SpacesInContainerLiterals: false
39+
SpacesInParentheses: false
40+
SpacesInSquareBrackets: false
41+
FixNamespaceComments: true
42+
43+
# Wrapping and braces
44+
AlwaysBreakAfterReturnType: TopLevel
45+
AlwaysBreakTemplateDeclarations: Yes
46+
47+
AllowAllArgumentsOnNextLine: false
48+
AllowAllConstructorInitializersOnNextLine: false
49+
AllowAllParametersOfDeclarationOnNextLine: false
50+
AllowShortBlocksOnASingleLine: Always
51+
AllowShortCaseLabelsOnASingleLine: false
52+
AllowShortFunctionsOnASingleLine: Inline
53+
AllowShortIfStatementsOnASingleLine: Never
54+
AllowShortLambdasOnASingleLine: All
55+
AllowShortLoopsOnASingleLine: false
56+
57+
BreakInheritanceList: AfterColon
58+
BreakStringLiterals: true
59+
BreakConstructorInitializers: AfterColon
60+
BreakBeforeBraces: Custom
61+
BraceWrapping:
62+
AfterCaseLabel: false
63+
AfterClass: false
64+
AfterControlStatement: Never
65+
AfterEnum: false
66+
AfterFunction: true
67+
AfterNamespace: false
68+
AfterUnion: false
69+
BeforeCatch: false
70+
BeforeElse: false
71+
IndentBraces: false
72+
SplitEmptyFunction: false
73+
SplitEmptyRecord: true

0 commit comments

Comments
 (0)