128 lines
3.6 KiB
YAML
128 lines
3.6 KiB
YAML
Language: Cpp
|
|
BasedOnStyle: LLVM
|
|
|
|
AccessModifierOffset: -4
|
|
# AlignAfterOpenBracket: BlockIndent
|
|
|
|
# 让多行的赋值语句和声明进行对齐
|
|
AlignConsecutiveAssignments: true
|
|
AlignConsecutiveDeclarations: true
|
|
|
|
AlignEscapedNewlines: Left
|
|
AlignOperands: Align
|
|
AlignTrailingComments: true
|
|
AllowAllParametersOfDeclarationOnNextLine: false
|
|
# AllowAllConstructorInitializersOnNextLine: false
|
|
|
|
# 禁止将多行语句写在一起
|
|
AllowShortBlocksOnASingleLine: false
|
|
AllowShortCaseLabelsOnASingleLine: false
|
|
AllowShortFunctionsOnASingleLine: Empty # 只有空函数允许单行
|
|
AllowShortIfStatementsOnASingleLine: false
|
|
AllowShortLambdasOnASingleLine: Empty
|
|
AllowShortLoopsOnASingleLine: false
|
|
AllowShortEnumsOnASingleLine: false
|
|
|
|
AlwaysBreakAfterDefinitionReturnType: None
|
|
AlwaysBreakAfterReturnType: None
|
|
AlwaysBreakBeforeMultilineStrings: false
|
|
AlwaysBreakTemplateDeclarations: Yes
|
|
AlignConsecutiveMacros: true
|
|
BinPackArguments: false
|
|
BinPackParameters: false
|
|
BraceWrapping:
|
|
AfterCaseLabel: false
|
|
AfterClass: false
|
|
AfterControlStatement: Never
|
|
AfterEnum: false
|
|
AfterFunction: false
|
|
AfterNamespace: false
|
|
AfterUnion: false
|
|
BeforeCatch: true
|
|
BeforeElse: true
|
|
BeforeLambdaBody: false
|
|
IndentBraces: false
|
|
SplitEmptyFunction: false
|
|
SplitEmptyRecord: true
|
|
SplitEmptyNamespace: false
|
|
AfterObjCDeclaration: false
|
|
AfterExternBlock: false
|
|
AfterStruct: false
|
|
BreakBeforeBinaryOperators: None
|
|
BreakBeforeTernaryOperators: false
|
|
BreakBeforeConceptDeclarations: true
|
|
BreakBeforeInheritanceComma: false
|
|
# BreakConstructorInitializers: AfterColon
|
|
BreakAfterJavaFieldAnnotations: true
|
|
BreakStringLiterals: true
|
|
BreakConstructorInitializersBeforeComma: false
|
|
# ColumnLimit: 110
|
|
# ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|
# SortIncludes: true
|
|
CompactNamespaces: true
|
|
ContinuationIndentWidth: 4
|
|
IndentCaseLabels: true
|
|
IndentPPDirectives: None
|
|
IndentExternBlock: NoIndent
|
|
IndentWidth: 4
|
|
KeepEmptyLinesAtTheStartOfBlocks: true
|
|
MaxEmptyLinesToKeep: 1
|
|
# NamespaceIndentation: None
|
|
ObjCSpaceAfterProperty: false
|
|
ObjCSpaceBeforeProtocolList: false
|
|
PointerAlignment: Left
|
|
ReflowComments: false
|
|
SpaceAfterCStyleCast: false
|
|
SpaceAfterLogicalNot: false
|
|
SpaceAfterTemplateKeyword: false
|
|
SpaceBeforeAssignmentOperators: true
|
|
SpaceBeforeCpp11BracedList: false
|
|
SpaceBeforeCtorInitializerColon: true
|
|
SpaceBeforeInheritanceColon: true
|
|
SpaceBeforeParens: ControlStatements
|
|
SpaceBeforeRangeBasedForLoopColon: true
|
|
SpaceInEmptyParentheses: false
|
|
# SpacesBeforeTrailingComments: 1
|
|
SpacesInAngles: false
|
|
SpacesInCStyleCastParentheses: false
|
|
SpacesInContainerLiterals: false
|
|
SpacesInParentheses: false
|
|
SpacesInSquareBrackets: false
|
|
TabWidth: 4
|
|
UseTab: Never
|
|
IndentRequires: true
|
|
SpacesInConditionalStatement: false
|
|
SortUsingDeclarations: true
|
|
Standard: c++20
|
|
|
|
# 同一行长度限制
|
|
ColumnLimit: 110
|
|
|
|
# 排序include
|
|
SortIncludes: true
|
|
|
|
IncludeCategories:
|
|
# 1. 匹配所有 .generated.h 文件,给它一个极大的优先级数字(比如 99)
|
|
# 数字越大,排序越靠后
|
|
- Regex: '.*\.generated\.h'
|
|
Priority: 99
|
|
|
|
# 2. 匹配其他所有文件,优先级设为 1
|
|
- Regex: '.*'
|
|
Priority: 1
|
|
|
|
# 注释前面需要有1个空格
|
|
SpacesBeforeTrailingComments: 1
|
|
|
|
# 如果某行太长,则总是在左小括号后换行,同时右小括号也换行
|
|
AlignAfterOpenBracket: BlockIndent
|
|
|
|
# 构造函数的初始化列表前需要换行
|
|
BreakConstructorInitializers: AfterColon
|
|
# 构造函数的初始化列表必须换行
|
|
AllowAllConstructorInitializersOnNextLine: false
|
|
# 构造函数的初始化列表要么都在同一行,要么都各自一行
|
|
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|
|
|
# 命名空间前面不空格
|
|
NamespaceIndentation: None |