Skip to content

Commit f2d3d13

Browse files
authored
API Style Update (December 2025)
API Style Update
2 parents 43f05d4 + 53f2283 commit f2d3d13

56 files changed

Lines changed: 1572 additions & 910 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 166 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,140 +1,189 @@
11
---
22
Language: Cpp
3+
# BasedOnStyle: Microsoft
34

45
DisableFormat: false
56

6-
# GENERAL INDENTATION
7-
UseTab: Never
8-
TabWidth: 4
9-
IndentWidth: 4
10-
117
AccessModifierOffset: -2
12-
138
AlignAfterOpenBracket: BlockIndent
149
AlignArrayOfStructures: Right
10+
1511
AlignConsecutiveAssignments:
16-
Enabled: true
17-
AcrossEmptyLines: true
18-
AcrossComments: false
19-
AlignCompound: false
12+
Enabled: true
13+
AcrossEmptyLines: false
14+
AcrossComments: false
15+
AlignCompound: false
2016
AlignFunctionPointers: false
21-
PadOperators: true
17+
PadOperators: true
18+
19+
AlignConsecutiveBitFields:
20+
Enabled: false
21+
AcrossEmptyLines: false
22+
AcrossComments: false
23+
AlignCompound: false
24+
AlignFunctionPointers: false
25+
PadOperators: false
26+
27+
AlignConsecutiveDeclarations:
28+
Enabled: false
29+
AcrossEmptyLines: false
30+
AcrossComments: false
31+
AlignCompound: false
32+
AlignFunctionPointers: false
33+
PadOperators: false
34+
2235
AlignConsecutiveMacros:
23-
Enabled: true
24-
AcrossEmptyLines: true
25-
AcrossComments: false
26-
AlignCompound: false
36+
Enabled: false
37+
AcrossEmptyLines: false
38+
AcrossComments: false
39+
AlignCompound: false
2740
AlignFunctionPointers: false
28-
PadOperators: false
41+
PadOperators: false
42+
43+
AlignConsecutiveShortCaseStatements:
44+
Enabled: false
45+
AcrossEmptyLines: false
46+
AcrossComments: false
47+
AlignCaseColons: false
48+
2949
AlignEscapedNewlines: Right
30-
AlignOperands: Align
50+
AlignOperands: Align
51+
3152
AlignTrailingComments:
32-
Kind: Always
33-
OverEmptyLines: 2
53+
Kind: Always
54+
OverEmptyLines: 2
3455

3556
AllowAllArgumentsOnNextLine: true
3657
AllowAllParametersOfDeclarationOnNextLine: true
37-
AllowBreakBeforeNoexceptSpecifier: Always
38-
AllowShortBlocksOnASingleLine: Never
58+
AllowBreakBeforeNoexceptSpecifier: Never
59+
AllowShortBlocksOnASingleLine: Empty
3960
AllowShortCaseLabelsOnASingleLine: false
40-
AllowShortCompoundRequirementOnASingleLine: false
61+
AllowShortCompoundRequirementOnASingleLine: true
4162
AllowShortEnumsOnASingleLine: true
42-
AllowShortFunctionsOnASingleLine: InlineOnly
63+
AllowShortFunctionsOnASingleLine: None
4364
AllowShortIfStatementsOnASingleLine: Never
44-
AllowShortLambdasOnASingleLine: All
65+
AllowShortLambdasOnASingleLine: Empty
4566
AllowShortLoopsOnASingleLine: false
46-
47-
AlwaysBreakAfterReturnType: None
67+
#AllowShortNamespacesOnASingleLine: true
4868
AlwaysBreakAfterDefinitionReturnType: None
49-
AlwaysBreakBeforeMultilineStrings: false
69+
AlwaysBreakAfterReturnType: None
70+
AlwaysBreakBeforeMultilineStrings: true
5071
AlwaysBreakTemplateDeclarations: true
5172

73+
# AttributeMacros:
74+
# - __capability
75+
5276
BinPackArguments: false
53-
BinPackParameters: false
77+
BinPackParameters: true
78+
BitFieldColonSpacing: Both
5479

5580
BreakBeforeBraces: Custom
5681
BraceWrapping:
57-
AfterCaseLabel: true
58-
AfterClass: false
82+
AfterCaseLabel: true
83+
AfterClass: false
5984
AfterControlStatement: false
60-
AfterEnum: false
85+
AfterEnum: false
6186
AfterExternBlock: true
62-
AfterFunction: true
63-
AfterNamespace: true
64-
AfterStruct: false
65-
AfterUnion: false
66-
BeforeCatch: false
67-
BeforeElse: false
87+
AfterFunction: true
88+
AfterNamespace: true
89+
AfterStruct: false
90+
AfterUnion: false
91+
BeforeCatch: false
92+
BeforeElse: false
6893
BeforeLambdaBody: true
69-
BeforeWhile: false
70-
IndentBraces: false
94+
BeforeWhile: false
95+
IndentBraces: false
7196
SplitEmptyFunction: false
7297
SplitEmptyRecord: false
73-
SplitEmptyNamespace: true
98+
SplitEmptyNamespace: false
99+
74100
BreakAdjacentStringLiterals: true
75-
BreakAfterAttributes: Never
76-
#BreakAfterReturnType: Automatic
101+
BreakAfterAttributes: Leave
102+
BreakArrays: true
77103
BreakBeforeBinaryOperators: None
78104
BreakBeforeConceptDeclarations: Always
105+
BreakBeforeInlineASMColon: OnlyMultiline
79106
BreakBeforeTernaryOperators: false
80107
BreakConstructorInitializers: BeforeColon
81108
BreakInheritanceList: AfterColon
82109
BreakStringLiterals: true
83-
84-
ColumnLimit: 95
110+
ColumnLimit: 95
111+
CommentPragmas: '^ IWYU pragma:'
85112
CompactNamespaces: false
86113
ConstructorInitializerIndentWidth: 4
87114
ContinuationIndentWidth: 4
88-
Cpp11BracedListStyle: false
89-
115+
Cpp11BracedListStyle: true
90116
DerivePointerAlignment: false
91-
92117
EmptyLineAfterAccessModifier: Never
93-
EmptyLineBeforeAccessModifier: Always
94-
ExperimentalAutoDetectBinPacking: true
95-
118+
EmptyLineBeforeAccessModifier: LogicalBlock
119+
ExperimentalAutoDetectBinPacking: false
96120
FixNamespaceComments: true
97121

98-
IncludeBlocks: Preserve
122+
# ForEachMacros:
123+
# - foreach
124+
# - Q_FOREACH
125+
# - BOOST_FOREACH
126+
# IfMacros:
127+
# - KJ_IF_MAYBE
128+
129+
IncludeCategories:
130+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
131+
Priority: 2
132+
SortPriority: 0
133+
CaseSensitive: false
134+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
135+
Priority: 3
136+
SortPriority: 0
137+
CaseSensitive: false
138+
- Regex: '.*'
139+
Priority: 1
140+
SortPriority: 0
141+
CaseSensitive: false
142+
143+
IncludeIsMainRegex: '(Test)?$'
144+
IncludeIsMainSourceRegex: ''
145+
IncludeBlocks: Preserve
99146
IndentAccessModifiers: false
100147
IndentCaseBlocks: false
101148
IndentCaseLabels: false
102149
IndentExternBlock: NoIndent
103-
IndentGotoLabels: false
104-
IndentPPDirectives: BeforeHash
105-
IndentRequiresClause: false
150+
IndentGotoLabels: true
151+
IndentPPDirectives: AfterHash
152+
IndentRequiresClause: true
153+
IndentWidth: 4
106154
IndentWrappedFunctionNames: false
107-
InsertBraces: false
155+
InsertBraces: false
156+
InsertNewlineAtEOF: false
108157
InsertTrailingCommas: None
158+
109159
IntegerLiteralSeparator:
110-
Binary: 0
111-
Decimal: 3
112-
Hex: 4
160+
Binary: 0
161+
Decimal: 3
162+
Hex: 4
113163

164+
KeepEmptyLinesAtTheStartOfBlocks: false
165+
KeepEmptyLinesAtEOF: true
114166
LambdaBodyIndentation: Signature
115-
167+
LineEnding: DeriveLF
168+
MacroBlockBegin: ''
169+
MacroBlockEnd: ''
116170
MaxEmptyLinesToKeep: 2
117-
118-
NamespaceIndentation: All
119-
171+
NamespaceIndentation: None
120172
PackConstructorInitializers: BinPack
121173
PointerAlignment: Left
122-
PPIndentWidth: -1
123-
174+
PPIndentWidth: -1
124175
QualifierAlignment: Leave
125-
126176
ReferenceAlignment: Pointer
127-
ReflowComments: true
177+
ReflowComments: true
178+
RemoveBracesLLVM: false
128179
RemoveParentheses: Leave
129180
RemoveSemicolon: false
130-
#RequiresClausePosition: OwnLineWithBrace
181+
RequiresClausePosition: OwnLine
131182
RequiresExpressionIndentation: OuterScope
132-
133183
SeparateDefinitionBlocks: Always
134-
ShortNamespaceLines: 3
135-
#SortIncludes:
136-
# Enabled: true
137-
# IgnoreCase: false
184+
ShortNamespaceLines: 1
185+
SkipMacroDefinitionBody: false
186+
SortIncludes: CaseSensitive
138187
SortUsingDeclarations: LexicographicNumeric
139188
SpaceAfterCStyleCast: false
140189
SpaceAfterLogicalNot: false
@@ -145,35 +194,67 @@ SpaceBeforeCaseColon: false
145194
SpaceBeforeCpp11BracedList: false
146195
SpaceBeforeCtorInitializerColon: true
147196
SpaceBeforeInheritanceColon: true
197+
SpaceBeforeJsonColon: false
198+
148199
SpaceBeforeParens: Custom
149200
SpaceBeforeParensOptions:
150201
AfterControlStatements: true
151202
AfterForeachMacros: true
152203
AfterFunctionDefinitionName: false
153204
AfterFunctionDeclarationName: false
154-
AfterIfMacros: true
205+
AfterIfMacros: true
155206
AfterOverloadedOperator: false
156207
AfterPlacementOperator: true
157208
AfterRequiresInClause: false
158209
AfterRequiresInExpression: false
159210
BeforeNonEmptyParentheses: false
211+
160212
SpaceBeforeRangeBasedForLoopColon: true
161213
SpaceBeforeSquareBrackets: false
162214
SpaceInEmptyBlock: true
163215
SpacesBeforeTrailingComments: 1
216+
SpacesInAngles: Never
217+
SpacesInContainerLiterals: true
164218

165-
# PENALTIES:
166-
PenaltyReturnTypeOnItsOwnLine: 10000
167-
PenaltyBreakTemplateDeclaration: 10000
168-
#PenaltyBreakBeforeMemberAccess: 10000
169-
PenaltyBreakAssignment: 800
170-
PenaltyBreakScopeResolution: 500
219+
SpacesInLineCommentPrefix:
220+
Minimum: 1
221+
Maximum: -1
222+
223+
SpacesInParens: Never
224+
SpacesInParensOptions:
225+
InCStyleCasts: false
226+
InConditionalStatements: false
227+
InEmptyParentheses: false
228+
Other: false
229+
230+
SpacesInSquareBrackets: false
231+
Standard: Latest
232+
TabWidth: 4
233+
UseTab: Never
234+
VerilogBreakBetweenInstancePorts: true
235+
236+
# StatementAttributeLikeMacros:
237+
# - Q_EMIT
238+
239+
# StatementMacros:
240+
# - Q_UNUSED
241+
# - QT_REQUIRE_VERSION
242+
243+
# WhitespaceSensitiveMacros:
244+
# - BOOST_PP_STRINGIZE
245+
# - CF_SWIFT_NAME
246+
# - NS_SWIFT_NAME
247+
# - PP_STRINGIZE
248+
# - STRINGIZE
249+
250+
PenaltyBreakAssignment: 2
251+
PenaltyBreakBeforeFirstCallParameter: 10
171252
PenaltyBreakComment: 500
172253
PenaltyBreakFirstLessLess: 120
173-
PenaltyExcessCharacter: 100
174-
PenaltyBreakBeforeFirstCallParameter: 10
175-
PenaltyBreakString: 10
176-
PenaltyBreakOpenParenthesis: 10
254+
PenaltyBreakOpenParenthesis: 0
255+
PenaltyBreakScopeResolution: 500
256+
PenaltyBreakString: 100
257+
PenaltyBreakTemplateDeclaration: 10
258+
PenaltyExcessCharacter: 1000000
177259
PenaltyIndentedWhitespace: 0
178-
179-
...
260+
PenaltyReturnTypeOnItsOwnLine: 10000

.clang-tidy

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Checks: >
2+
-*,
3+
misc-*,
4+
cert-*,
5+
bugprone-*,
6+
cppcoreguidelines-*,
7+
modernize-*,
8+
performance-*,
9+
portability-*,
10+
readability-*,
11+
12+
# Explicitly disable some checks that might be noisy
13+
-cppcoreguidelines-avoid-magic-numbers,
14+
-cppcoreguidelines-pro-type-member-init,
15+
-modernize-use-auto,
16+
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
17+
-modernize-use-trailing-return-type,
18+
-readability-function-size,
19+
-readability-magic-numbers,
20+
-readability-identifier-length,
21+
-readability-avoid-const-params-in-decls,
22+
23+
WarningsAsErrors: ''
24+
25+
FormatStyle: none
26+
27+
# CheckOptions:
28+
29+
HeaderFilterRegex: ''
30+
31+
SystemHeaders: false
32+
33+
InheritParentConfig: false

.github/disabled_workflows/linux-build.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ jobs:
1717
fail-fast: false
1818

1919
matrix:
20-
cmake_preset: ["linux-x64-Debug", "linux-x64-Release"]
20+
cmake_preset: [
21+
"linux-x64-gcc-debug",
22+
"linux-x64-clang-debug",
23+
"linux-x64-gcc-release",
24+
"linux-x64-clang-release"
25+
]
2126

2227
steps:
2328
- name: Checkout Repository

.github/disabled_workflows/macos-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
fail-fast: false
1818

1919
matrix:
20-
cmake_preset: ["macos-x64-Debug", "macos-x64-Release"]
20+
cmake_preset: ["macos-x64-clang-debug", "macos-x64-clang-release"]
2121

2222
steps:
2323
- name: Checkout Repository

0 commit comments

Comments
 (0)