Debian Codegraph @

.clang-format

raw
1 # 基于那个配置文件 https://clang.llvm.org/docs/ClangFormatStyleOptions.html
2 BasedOnStyle: WebKit
3 # 访问说明符的偏移(public private)
4 AccessModifierOffset: -4
5 # 括号之后,水平对齐参数: Align DontAlign AlwaysBreak。
6 AlignAfterOpenBracket: Align
7 #AlignConsecutiveBitFields: false
8 # 连续的赋值时,对齐所有的等号
9 AlignConsecutiveAssignments: false
10 # 连续声明时,对齐所有声明的变量名
11 AlignConsecutiveDeclarations: false
12 #AlignConsecutiveMacros: false
13 AlignEscapedNewlines: DontAlign
14 # 水平对齐二元和三元表达式的操作数
15 AlignOperands: true
16 # 对齐连续的尾随的注释
17 AlignTrailingComments: false
18 #AllowAllArgumentsOnNextLine: false
19 #AllowAllConstructorInitializersOnNextLine: false
20 # 允许函数声明的所有参数在放在下一行
21 AllowAllParametersOfDeclarationOnNextLine: false
22 # 允许短的块放在同一行
23 AllowShortBlocksOnASingleLine: true
24 # 允许短的case标签放在同一行
25 AllowShortCaseLabelsOnASingleLine: false
26 #AllowShortEnumsOnASingleLine: false
27 # 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All
28 AllowShortFunctionsOnASingleLine: InlineOnly
29 # 是否允许短if单行 If true, if (a) return; 可以放到同一行
30 AllowShortIfStatementsOnASingleLine: false
31 #AllowShortLambdasOnASingleLine: Inline
32 # 允许短的循环保持在同一行
33 AllowShortLoopsOnASingleLine: false
34 # 总是在定义返回类型后换行(deprecated)
35 AlwaysBreakAfterDefinitionReturnType: None
36 AlwaysBreakBeforeMultilineStrings: false
37 AlwaysBreakTemplateDeclarations: Yes
38 BinPackArguments: true
39 BinPackParameters: true
40 BreakBeforeBraces: Custom
41 BraceWrapping:
42 # AfterCaseLabel: false
43 AfterClass: true
44 AfterControlStatement: false
45 AfterEnum: false
46 AfterFunction: true
47 AfterNamespace: false
48 AfterStruct: false
49 AfterUnion: false
50 AfterExternBlock: false
51 BeforeCatch: false
52 BeforeElse: false
53 # BeforeLambdaBody: false
54 # BeforeWhile: false
55 SplitEmptyFunction: true
56 SplitEmptyRecord: true
57 SplitEmptyNamespace: true
58
59 BreakBeforeBinaryOperators: NonAssignment
60 BreakBeforeTernaryOperators: true
61 #在构造函数初始化时按逗号断行,并以冒号对齐
62 BreakConstructorInitializers: BeforeComma
63 BreakInheritanceList: BeforeComma
64 BreakStringLiterals: false
65 # 每行字符的限制,0表示没有限制
66 ColumnLimit: 0
67 # 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
68 # CommentPragmas: '^ IWYU pragma:'
69 # 语言: None Cpp Java Objc Protp
70 CompactNamespaces: false
71 Cpp11BracedListStyle: true
72 #DeriveLineEnding: \n
73 DerivePointerAlignment: false
74 FixNamespaceComments: true
75 ForEachMacros: ["foreach", "Q_FOREACH"]
76 IncludeBlocks: Regroup
77 IncludeCategories:
78 - Regex: '^"'
79 Priority: 1
80 - Regex: '^["<]D'
81 Priority: 2
82 - Regex: '^<Q'
83 Priority: 3
84 - Regex: '^<'
85 Priority: 4
86 - Regex: '\.h>$'
87 Priority: 5
88 - Regex: '^"moc_'
89 Priority: 99
90 - Regex: '\.moc"'
91 Priority: 99
92
93 # 缩进case 标签
94 IndentCaseLabels: false
95 #IndentExternBlock: NoIndent
96 #IndentCaseBlocks: false
97 #IndentGotoLabels: false
98 IndentPPDirectives: None
99 #缩进宽度
100 IndentWidth: 4
101 IndentWrappedFunctionNames: false
102 #InsertTrailingCommas: None
103 #在block从空行开始
104 KeepEmptyLinesAtTheStartOfBlocks: false
105 Language: Cpp
106 # 连续的空行保留几行
107 MaxEmptyLinesToKeep: 1
108 NamespaceIndentation: None
109 #指针的*的挨着哪边
110 PointerAlignment: Right
111 # 允许排序#include, 造成编译错误
112 SortIncludes: false
113 SortUsingDeclarations: false
114 #括号后添加空格
115 SpaceAfterCStyleCast: false
116 #SpaceAfterLogicalNot: false
117 SpaceAfterTemplateKeyword: false
118 #等号两边的空格
119 SpaceBeforeAssignmentOperators: true
120 SpaceBeforeCpp11BracedList: true
121 SpaceBeforeCtorInitializerColon: false
122 SpaceBeforeParens: ControlStatements
123 SpaceBeforeRangeBasedForLoopColon: true
124 #SpaceBeforeSquareBrackets: false
125 #SpaceInEmptyBlock: true
126 SpaceInEmptyParentheses: false
127 SpacesBeforeTrailingComments: 1
128 SpacesInAngles: false
129 SpacesInCStyleCastParentheses: false
130 #SpacesInConditionalStatement: false
131 # 容器类的空格 例如 OC的字典
132 SpacesInContainerLiterals: false
133 # 小括号两边添加空格
134 SpacesInParentheses: false
135 # 中括号两边空格 []
136 SpacesInSquareBrackets: false
137 #StatementMacros: ["Q_UNUSED"]
138 #tab键盘的宽度
139 TabWidth: 4
140 UseTab: Never