-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
95 lines (87 loc) · 2.4 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
BasedOnStyle: Google
# alignment
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlinesLeft: 'true'
AlignOperands: 'false'
AlignTrailingComments: 'true'
ColumnLimit: 120
DerivePointerAlignment: false
PointerAlignment: Left
QualifierAlignment: Custom
QualifierOrder: ['inline', 'static', 'constexpr', 'const', 'type']
ReferenceAlignment: Left
ReflowComments: false
# bracing
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
# breaking
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: 'true'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: 'true'
BreakConstructorInitializers: BeforeColon
# indentation
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentWidth: 4
NamespaceIndentation: All
# shorties
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortEnumsOnASingleLine: 'true'
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: 'false'
# spacing
KeepEmptyLinesAtTheStartOfBlocks: 'false'
PenaltyBreakString: '3'
SpaceBeforeParens: ControlStatements
SpacesInAngles: 'false'
SpacesInContainerLiterals: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
Standard: c++20
UseTab: Never
# wrapping
PackConstructorInitializers: NextLine
BinPackParameters: 'false'
BinPackArguments: 'false'
# Include block sorting in the following order:
# - Main header for source file (clang-format default prioritizes this first)
# - Relative path includes in quotation marks
# - Absolute path includes in angle brackets
# - External dependencies
# - System dependencies
SortIncludes: CaseInsensitive
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '".+\.h'
Priority: 2
- Regex: '<winsock2\.h>'
Priority: 3
- Regex: '<windows\.h>'
Priority: 4
- Regex: '^<.*\.h(pp)?>$'
Priority: 5
- Regex: '(<)(.)+(>)'
Priority: 6