-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.clang-format
87 lines (84 loc) · 2.85 KB
/
.clang-format
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# 语言: None Cpp Java Objc Protp
Language: Cpp
# Only merge empty blocks.
# 基于那个配置文件
BasedOnStyle: LLVM
# 访问说明符的偏移(public private)
AccessModifierOffset: -2
# 括号之后,水平对齐参数: Align DontAlign AlwaysBreak
AlignAfterOpenBracket: DontAlign
# 连续的赋值时,对齐所有的等号
AlignConsecutiveAssignments: false
# 连续声明时,对齐所有声明的变量名
AlignConsecutiveDeclarations: false
# 左对齐换行(使用反斜杠换行)的反斜杠
AlignEscapedNewlinesLeft: true
# 水平对齐二元和三元表达式的操作数
AlignOperands: true
# 对齐连续的尾随的注释
AlignTrailingComments: true
# 允许函数声明的所有参数在放在下一行
AllowAllParametersOfDeclarationOnNextLine: true
# 允许短的块放在同一行
AllowShortBlocksOnASingleLine: Always
# 允许短的case标签放在同一行
AllowShortCaseLabelsOnASingleLine: true
# 是否允许短if单行 If true, if (a) return; 可以放到同一行
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
# 允许短的循环保持在同一行
AllowShortLoopsOnASingleLine: true
# 是否允许短方法单行
AllowShortFunctionsOnASingleLine: All
# 每行字符的限制,0表示没有限制
ColumnLimit: 100
# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
CommentPragmas: '^ IWYU pragma:'
#指针的*的挨着哪边
PointerAlignment: Right
#缩进宽度
IndentWidth: 2
# 连续的空行保留几行
MaxEmptyLinesToKeep: 1
# 在 @property 后面添加空格, \@property (readonly) 而不是 \@property(readonly).
ObjCSpaceAfterProperty: true
# OC block后面的缩进
ObjCBlockIndentWidth: 2
# 中括号两边空格 []
SpacesInSquareBrackets: false
# 小括号两边添加空格
SpacesInParentheses : false
#等号两边的空格
SpaceBeforeAssignmentOperators: true
# 容器类的空格 例如 OC的字典
SpacesInContainerLiterals: false
#缩进
IndentWrappedFunctionNames: true
#在block从空行开始
KeepEmptyLinesAtTheStartOfBlocks: true
#在构造函数初始化时按逗号断行,并以冒号对齐
BreakConstructorInitializersBeforeComma: true
# 括号后添加空格
SpaceAfterCStyleCast: false
# 允许排序#include, 造成编译错误
# SortIncludes: true
# 缩进case 标签
IndentCaseLabels: true
#tab键盘的宽度
TabWidth: 2
UseTab: Never
# Always attach braces to surrounding context.
BreakBeforeBraces: Attach
# Indent in all namespaces.
NamespaceIndentation: All
# Horizontally align operands of binary and ternary expressions.
AlignOperands: Align
# aligns trailing comments.
AlignTrailingComments: false
# The column limit.
ColumnLimit: 87
# Indent width for line continuations.
ContinuationIndentWidth: 2
# Don’t align, instead use ContinuationIndentWidth
AlignAfterOpenBracket: DontAlign
RemoveBracesLLVM: true