-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
83 lines (64 loc) · 2.44 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
Language: Cpp
#If true, analyze the formatted file for the most common alignment of & and *. PointerAlignment is then used only as fallback.
DerivePointerAlignment: false
IndentWidth: 4
#@[]里面两边空格,原true
SpacesInContainerLiterals: false
#Add a space after @property in Objective-C, i.e. use \@property (readonly) instead of \@property(readonly).
ObjCSpaceAfterProperty: true
#The number of characters to use for indentation of ObjC blocks.
ObjCBlockIndentWidth: 4
#If true, if (a) return; can be put on a single line.
AllowShortIfStatementsOnASingleLine: true
#If false, spaces will be removed before assignment operators.
SpaceBeforeAssignmentOperators: true
#Pointer and reference alignment style.
PointerAlignment: Right
#The maximum number of consecutive empty lines to keep.
MaxEmptyLinesToKeep: 1
#每行字符的长度
ColumnLimit: 0
#注释对齐
AlignTrailingComments: true
AlignAfterOpenBracket: Align
# 多行赋值语句按 = 号对齐
AlignConsecutiveAssignments: false
# 多行声明语句按 = 号对齐
AlignConsecutiveDeclarations: false
#括号后加空格
SpaceAfterCStyleCast: true
AlignConsecutiveMacros: true
# 允许短的块放在同一行
AllowShortBlocksOnASingleLine: false
# 大括号换行,只有当BreakBeforeBraces设置为Custom时才有效
BraceWrapping:
# class定义后面
AfterClass: false
# 控制语句后面
AfterControlStatement: true
# enum定义后面
AfterEnum: false
# 函数定义后面
AfterFunction: false
# 命名空间定义后面
AfterNamespace: false
# ObjC定义后面
AfterObjCDeclaration: false
# struct定义后面
AfterStruct: false
# union定义后面
AfterUnion: false
# catch之前
BeforeCatch: true
# else之前
BeforeElse: true
# 缩进大括号
IndentBraces: true
# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行)
BreakBeforeBinaryOperators: NonAssignment
# 在大括号前换行: Attach(始终将大括号附加到周围的上下文), Linux(除函数、命名空间和类定义,与Attach类似),
# Mozilla(除枚举、函数、记录定义,与Attach类似), Stroustrup(除函数定义、catch、else,与Attach类似),
# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom
# 注:这里认为语句块也属于函数
BreakBeforeBraces: Linux
---