forked from LandSandBoat/server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.clang-format
More file actions
142 lines (119 loc) · 3.3 KB
/
Copy path.clang-format
File metadata and controls
142 lines (119 loc) · 3.3 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
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
---
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# We base things of WebKit + Allman braces
# Compatible with clang-format-20
Language: Cpp
# Access modifiers
AccessModifierOffset: -4
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
IndentAccessModifiers: false
# Alignment settings
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true
AlignConsecutiveMacros: true
AlignEscapedNewlines: Right
AlignOperands: Align
AlignTrailingComments: true
# Short constructs
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AllowShortLoopsOnASingleLine: false
# Note: LambdaBodyIndentation not available in clang-format-20
# Template declarations
AlwaysBreakTemplateDeclarations: Yes
# Braces - Allman style
BreakBeforeBraces: Allman
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
AfterExternBlock: true
# Constructor and inheritance
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeColon
ConstructorInitializerIndentWidth: 0
PackConstructorInitializers: BinPack
# Line limits and wrapping
ColumnLimit: 0 # Use your best judgement
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
BinPackArguments: false
BinPackParameters: false
# Namespaces
CompactNamespaces: false
NamespaceIndentation: None
# Braced lists and initializers
Cpp11BracedListStyle: false
# Indentation
IndentWidth: 4
IndentCaseLabels: true
IndentPPDirectives: None
IndentWrappedFunctionNames: false
ContinuationIndentWidth: 4
# Empty lines
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
# Pointer and reference alignment
PointerAlignment: Left
ReferenceAlignment: Pointer
# Note: QualifierAlignment not available in clang-format-20, use manual const placement
# Comments
ReflowComments: Always
SpacesBeforeTrailingComments: 1
# Include sorting
SortIncludes: true
SortUsingDeclarations: LexicographicNumeric
# Spacing
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
BeforeNonEmptyParentheses: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInParens: Never
SpacesInSquareBrackets: false
# C++ standard
Standard: Latest
# Tabs
UseTab: Never
TabWidth: 4
# Binary operators
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
# String handling
BreakStringLiterals: true
# Other formatting options
FixNamespaceComments: true
...