-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.clang-format
More file actions
75 lines (63 loc) · 1.59 KB
/
.clang-format
File metadata and controls
75 lines (63 loc) · 1.59 KB
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
# Clang-Format configuration file
# Based on Google C++ style with moderate adjustments
Language: Cpp
BasedOnStyle: Google
# Indentation
IndentWidth: 4
TabWidth: 4
UseTab: Never
AccessModifierOffset: -4
# Line width
ColumnLimit: 100
# Braces
BreakBeforeBraces: Attach
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortBlocksOnASingleLine: Empty
# Pointer and reference alignment
PointerAlignment: Left
ReferenceAlignment: Left
# Include file sorting
SortIncludes: CaseSensitive
IncludeBlocks: Regroup
IncludeCategories:
# 1. Project headers
- Regex: '^"(client|server|common|protocol)/'
Priority: 1
# 2. Third-party libraries
- Regex: '^<.*\.h>'
Priority: 2
# 3. C++ standard library
- Regex: '^<.*>'
Priority: 3
# Namespace
NamespaceIndentation: None
CompactNamespaces: false
FixNamespaceComments: true
# Alignment
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: true
AlignTrailingComments: true
# Line breaking
AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: true
BinPackParameters: true
BreakConstructorInitializers: BeforeColon
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# Spacing
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpacesInAngles: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# C++11 features
Standard: c++17
Cpp11BracedListStyle: true
# Comments
ReflowComments: true
SpacesBeforeTrailingComments: 2