# 配置参考: # https://clang.llvm.org/docs/ClangFormatStyleOptions.html # 基于那个配置文件 BasedOnStyle: Microsoft # 使用TAB UseTab: Always # TAB宽度 TabWidth: 4 # 行长度限制 ColumnLimit: 0 # 允许短的块放在同一行 AllowShortBlocksOnASingleLine: Empty # 是否允许短if单行 If true, if (a) return; 可以放到同一行 AllowShortIfStatementsOnASingleLine: AllIfsAndElse # 允许短的枚举放在同一行 AllowShortEnumsOnASingleLine: true # 允许短的case放在同一行 AllowShortCaseLabelsOnASingleLine: true # 允许短的循环保持在同一行 AllowShortLoopsOnASingleLine: true # 连续的空行保留几行 MaxEmptyLinesToKeep: 2 # 是否允许短方法单行 AllowShortFunctionsOnASingleLine: InlineOnly # 是否对include进行排序 SortIncludes: Never NamespaceIndentation: All # case前增加空白 IndentCaseLabels: true # 大括号换行 BraceWrapping: AfterEnum: false AfterStruct: false SplitEmptyFunction: false AfterClass: false AfterControlStatement: Never AfterFunction: true AfterNamespace: true AfterUnion: false AfterExternBlock: true BeforeCatch: true BeforeElse: true BeforeLambdaBody: false BeforeWhile: false