1 Star 4 Fork 0

Sshwy / code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.clang-format 2.86 KB
一键复制 编辑 原始数据 按行查看 历史
Sshwy 提交于 2021-03-27 14:21 . format files
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# 语言: None Cpp Java Objc Protp
Language: Cpp
# Only merge empty blocks.
AllowShortBlocksOnASingleLine: Empty
# 基于那个配置文件
BasedOnStyle: LLVM
# 访问说明符的偏移(public private)
AccessModifierOffset: -2
# 括号之后,水平对齐参数: Align DontAlign AlwaysBreak
AlignAfterOpenBracket: Align
# 连续的赋值时,对齐所有的等号
AlignConsecutiveAssignments: false
# 连续声明时,对齐所有声明的变量名
AlignConsecutiveDeclarations: false
# 左对齐换行(使用反斜杠换行)的反斜杠
AlignEscapedNewlinesLeft: true
# 水平对齐二元和三元表达式的操作数
AlignOperands: true
# 对齐连续的尾随的注释
AlignTrailingComments: true
# 允许函数声明的所有参数在放在下一行
AllowAllParametersOfDeclarationOnNextLine: true
# 允许短的块放在同一行
AllowShortBlocksOnASingleLine : true
# 允许短的case标签放在同一行
AllowShortCaseLabelsOnASingleLine: false
# 是否允许短if单行 If true, if (a) return; 可以放到同一行
AllowShortIfStatementsOnASingleLine: WithoutElse
# 允许短的循环保持在同一行
AllowShortLoopsOnASingleLine: true
# 每行字符的限制,0表示没有限制
ColumnLimit: 100
# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
CommentPragmas: '^ IWYU pragma:'
#指针的*的挨着哪边
PointerAlignment: Right
#缩进宽度
IndentWidth: 2
# 连续的空行保留几行
MaxEmptyLinesToKeep: 1
# 在 @property 后面添加空格, \@property (readonly) 而不是 \@property(readonly).
ObjCSpaceAfterProperty: true
# OC block后面的缩进
ObjCBlockIndentWidth: 2
# 是否允许短方法单行
AllowShortFunctionsOnASingleLine: true
# 中括号两边空格 []
SpacesInSquareBrackets: false
# 小括号两边添加空格
SpacesInParentheses : false
#等号两边的空格
SpaceBeforeAssignmentOperators: true
# 容器类的空格 例如 OC的字典
SpacesInContainerLiterals: true
#缩进
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: true
# The column limit.
ColumnLimit: 86
# Indent width for line continuations.
ContinuationIndentWidth: 4
# Don’t align, instead use ContinuationIndentWidth
AlignAfterOpenBracket: DontAlign
1
https://gitee.com/sshwy/code.git
git@gitee.com:sshwy/code.git
sshwy
code
code
master

搜索帮助