-
Notifications
You must be signed in to change notification settings - Fork 2
/
.clang-format
195 lines (189 loc) · 6.1 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# SPDX-FileCopyrightText: 2019 Kitsune Ral <Kitsune-Ral@users.sf.net>
# SPDX-FileCopyrightText: 2019 Marc Deop <marc@marcdeop.com>
# SPDX-License-Identifier: LGPL-2.1-or-later
# This is the clang-format configuration style to be used by libQuotient.
# Inspired by:
# https://code.qt.io/cgit/qt/qt5.git/plain/_clang-format
# https://wiki.qt.io/Qt_Coding_Style
# https://wiki.qt.io/Coding_Conventions
# Further information: https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# For convenience, the file includes commented out settings that we assume
# to borrow from the WebKit style. The values for such settings try to but
# are not guaranteed to coincide with the latest version of the WebKit style.
# This file assumes ClangFormat 16 or newer
---
Language: Cpp
BasedOnStyle: WebKit
#AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignArrayOfStructures: Left # As of ClangFormat 14, Left doesn't work well
#AlignConsecutiveMacros: None
#AlignConsecutiveAssignments: None
#AlignConsecutiveDeclarations: None
#AlignConsecutiveShortCaseStatements: # ClangFormat 17
# Enabled: true
# AcrossEmptyLines: false
# AcrossComments: true
# AlignCaseColons: false
AlignEscapedNewlines: Left
AlignOperands: Align
#AlignTrailingComments: false
#AllowAllArgumentsOnNextLine: true
#AllowAllParametersOfDeclarationOnNextLine: true
#AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: true
#AllowShortEnumsOnASingleLine: true
#AllowShortFunctionsOnASingleLine: All
#AllowShortIfStatementsOnASingleLine: Never
#AllowShortLambdasOnASingleLine: All
#AllowShortLoopsOnASingleLine: false
#AlwaysBreakAfterDefinitionReturnType: None # deprecated
#AlwaysBreakAfterReturnType: None
#AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
#BinPackArguments: true
#BinPackParameters: true
#BitFieldColonSpacing: Both
BraceWrapping:
# AfterCaseLabel: false
# AfterClass: false
AfterControlStatement: MultiLine
# AfterEnum: false
# AfterExternBlock: false
AfterFunction: true
# AfterNamespace: false
# AfterStruct: false
# AfterUnion: false
# BeforeCatch: false
# BeforeElse: false
# BeforeLambdaBody: false # 'true' blows up lambdas vertically, even if they become _very_ readable
# BeforeWhile: false
# IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
#BreakAfterAttributes: Never # Leave might be more prudent
#BreakArrays: true # JSON only
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: Allowed
BreakBeforeBraces: Custom
#BreakBeforeTernaryOperators: true
#BreakConstructorInitializers: BeforeComma
#BreakInheritanceList: BeforeColon
#BreakStringLiterals: true
ColumnLimit: 100
CommentPragmas: '^ clazy:exclude=| NOLINT'
#CompactNamespaces: false
#ConstructorInitializerIndentWidth: 4
#ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
#DerivePointerAlignment: false
#EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
#ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '".+'
Priority: 8
- Regex: '^<(yaml-cpp|mustache).+/'
Priority: 16
- Regex: '^<Qt.+/'
Priority: 24
- Regex: '^<'
Priority: 32
IncludeIsMainRegex: '(_test)?$'
#IncludeIsMainSourceRegex: ''
#IndentAccessModifiers: false
#IndentCaseBlocks: false
#IndentCaseLabels: false
#IndentExternBlock: AfterExternBlock
IndentGotoLabels: false
IndentPPDirectives: AfterHash
#IndentRequiresClause: true
#IndentWidth: 4
#IndentWrappedFunctionNames: false
#InsertBraces: false
InsertNewlineAtEOF: true
IntegerLiteralSeparator:
Binary: 4
Decimal: 3
Hex: 4
KeepEmptyLinesAtTheStartOfBlocks: false
#KeepEmptyLinesAtEOF: false # ClangFormat 17
#LambdaBodyIndentation: Signature
#LineEnding: DeriveLF
#MacroBlockBegin: ''
#MacroBlockEnd: ''
#MaxEmptyLinesToKeep: 1
#NamespaceIndentation: Inner
PackConstructorInitializers: NextLine
#PenaltyBreakAssignment: 10
#PenaltyBreakBeforeFirstCallParameter: 70
#PenaltyBreakComment: 45
#PenaltyBreakFirstLessLess: 120
#PenaltyBreakOpenParenthesis: 0
#PenaltyBreakString: 200
#PenaltyBreakTemplateDeclaration: 10
#PenaltyExcessCharacter: 30
#PenaltyIndentedWhitespace: 0
#PenaltyReturnTypeOnItsOwnLine: 200
#PointerAlignment: Left
#PPIndentWidth: -1
#QualifierAlignment: Leave # See a warning in the docs; non-default reformats whole files
#ReferenceAlignment: Pointer
#ReflowComments: true
RemoveBracesLLVM: true # Note the warning in the docs, might better be false
#RemoveParentheses: Leave # ClangFormat 17
#RemoveSemicolon: false # Note the warning in the docs
RequiresClausePosition: OwnLine
#RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 20
#SortIncludes: CaseSensitive
#SortUsingDeclarations: LexicographicNumeric
#SpaceAfterCStyleCast: false
#SpaceAfterLogicalNot: false
#SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: After
#SpaceBeforeAssignmentOperators: true
#SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
#SpaceBeforeParens: ControlStatements
#SpaceBeforeParensOptions:
# AfterControlStatements: true
# AfterForeachMacros: true
# AfterFunctionDefinitionName: false
# AfterFunctionDeclarationName: false
# AfterIfMacros: true
# AfterOverloadedOperator: false
# AfterRequiresInClause: true
# AfterRequiresInExpression: false
# BeforeNonEmptyParentheses: false
#SpaceBeforeRangeBasedForLoopColon: true
#SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
#SpaceInEmptyParentheses: false
#SpacesBeforeTrailingComments: 1
#SpacesInAngles: Never
#SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
#SpacesInCStyleCastParentheses: false
#SpacesInLineCommentPrefix:
# Minimum: 1
# Maximum: -1
#SpacesInParentheses: false
#SpacesInSquareBrackets: false
Standard: c++20
StatementAttributeLikeMacros:
- Q_EMIT
- emit
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
#UseTab: Never
#WhitespaceSensitiveMacros: [] # Whatever's the default, not using it
...