-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.clang-format
122 lines (104 loc) · 2.52 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#
# Formatting Styles
#
# For more info: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# TODO:
# =====
# 1. Add `while` in new line in `do-while` statement.
# 2. Allow constructor initializer in the same line.
# 3. Add trailing comma in containers that were wrapped over multiple lines.
Language: Cpp
Standard: Cpp11
#
# Indentation
#
ColumnLimit: 0
TabWidth: 4
IndentWidth: 4
NamespaceIndentation: All
ConstructorInitializerIndentWidth: 4
AccessModifierOffset: -4
IndentCaseLabels: true
#
# Lines & Breaks
#
MaxEmptyLinesToKeep: 1
KeepEmptyLinesAtTheStartOfBlocks: false
CompactNamespaces: false
AllowShortBlocksOnASingleLine: true
AllowShortFunctionsOnASingleLine: Inline
AllowAllParametersOfDeclarationOnNextLine: true
AllowAllArgumentsOnNextLine: true
AllowShortLoopsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortCaseLabelsOnASingleLine: true
AllowAllConstructorInitializersOnNextLine: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterNamespace: true
AfterClass: true
AfterStruct: true
AfterUnion: true
AfterEnum: true
AfterFunction: true
AfterControlStatement: true
AfterCaseLabel: true
AfterExternBlock: true
BeforeElse: true
BeforeCatch: true
SplitEmptyFunction: true
SplitEmptyNamespace: true
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: No
AlwaysBreakBeforeMultilineStrings: false
#
# Spaces
#
SpaceAfterTemplateKeyword: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpacesInParentheses: false
SpaceInEmptyParentheses: false
SpacesInCStyleCastParentheses: false
SpacesInAngles: false
SpacesInSquareBrackets: false
SpaceAfterLogicalNot: false
SpacesBeforeTrailingComments: 1
#
# Alignment
#
AlignConsecutiveMacros: true
AlignConsecutiveDeclarations: false
AlignConsecutiveAssignments: false
AlignAfterOpenBracket: Align
AlignOperands: true
AlignTrailingComments: true
PointerAlignment: Left
BinPackArguments: false
BinPackParameters: false
#
# Includes
#
SortIncludes: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<[a-z_]+>'
Priority: 1
- Regex: '^<[a-z_]+.h>'
Priority: 1
- Regex: '^"[a-z_/]+"'
Priority: 100
- Regex: '^".+"'
Priority: 200
#
# Others
#
FixNamespaceComments: false