码迷,mamicode.com
首页 > 其他好文 > 详细

clang format 自定义样式常用参数说明

时间:2016-10-03 23:39:42      阅读:394      评论:0      收藏:0      [点我收藏+]

标签:

 常用的格式设置:

#如果为真(true),分析格式化过的文件中最常见的&和*的对齐方式。然后指针对齐仅作为回退
DerivePointerAlignment: false

#缩进宽度
IndentWidth: 4

#@[]里面两边空格,原true
SpacesInContainerLiterals: false

#OC中,在@property之后添加空格, 例如:使用 \@property (readonly) 而不是 \@property(readonly).
ObjCSpaceAfterProperty: true

#使用objc块(block)时缩进的字符数。
ObjCBlockIndentWidth: 4

#如果为真(true),这条语句:“if(a)return;”将被放在同一行
AllowShortIfStatementsOnASingleLine: true

#如果为假(false),空格将在赋值操作符之前被移除。
SpaceBeforeAssignmentOperators: true

#指针和引用的对齐样式:Right,Left,Center
PointerAlignment: Right

#保持连续空行的最大数量
MaxEmptyLinesToKeep: 1

#每行字符的长度
ColumnLimit: 0

#注释对齐
AlignTrailingComments: true

#括号后加空格
SpaceAfterCStyleCast: true

clang format 自定义样式常用参数说明

标签:

原文地址:http://www.cnblogs.com/PaulpauL/p/5929739.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!