22
33# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto, CSharp
44# Language: Cpp
5- # 标准: c++03, c++11, c++14, c++17, c++20, c++26, Latest, Auto
6- Standard : Auto
5+ # 标准: c++03, c++11, c++14, c++17, c++20, Latest, Auto
6+ # 使用 Latest 以支持 C++26 语法(clang-format 22+)
7+ Standard : Latest
78# 基于什么风格:LLVM、Google、GNU、Chromium、Mozilla、WebKit、Microsoft
89# BasedOnStyle: LLVM
910# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always
@@ -38,8 +39,8 @@ AlignEscapedNewlines: Left
3839AlignOperands : true
3940# 对齐连续的尾随的注释
4041AlignTrailingComments : true
41- # 允许所有构造函数初始化列表放在下一行
42- AllowAllConstructorInitializersOnNextLine : false
42+ # 构造函数初始化列表打包方式: Never, BinPack, CurrentLine, NextLine, NextLineOnly
43+ PackConstructorInitializers : NextLine
4344# 允许所有参数放在下一行
4445AllowAllArgumentsOnNextLine : false
4546# 允许函数声明的所有参数在放在下一行
@@ -56,15 +57,13 @@ AllowShortIfStatementsOnASingleLine: Never
5657AllowShortLoopsOnASingleLine : false
5758# 允许短的Lambdas在同一行
5859AllowShortLambdasOnASingleLine : None
59- # 总是在定义返回类型后换行(deprecated)
60- AlwaysBreakAfterDefinitionReturnType : None
61- # 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数),
62- # AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义)
63- AlwaysBreakAfterReturnType : None
60+ # 在返回类型后换行: None, Automatic, ExceptShortType, All, TopLevel,
61+ # AllDefinitions, TopLevelDefinitions
62+ BreakAfterReturnType : None
6463# 总是在多行string字面量前换行
6564AlwaysBreakBeforeMultilineStrings : false
66- # 总是在template声明后换行
67- AlwaysBreakTemplateDeclarations : Yes
65+ # 在template声明后换行: Leave, No, MultiLine, Yes
66+ BreakTemplateDeclarations : Yes
6867# false表示函数实参要么都在同一行,要么都各自一行
6968BinPackArguments : false
7069# false表示所有形参要么都在同一行,要么都各自一行
@@ -129,8 +128,7 @@ ColumnLimit: 120
129128PenaltyReturnTypeOnItsOwnLine : 999
130129# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
131130CommentPragmas : ' ^ IWYU pragma:'
132- # 构造函数的初始化列表要么都在同一行,要么都各自一行
133- ConstructorInitializerAllOnOneLineOrOnePerLine : true
131+ # (已由 PackConstructorInitializers 替代)
134132# 构造函数的初始化列表的缩进宽度
135133# ConstructorInitializerIndentWidth: 2
136134# 延续的行的缩进宽度
0 commit comments