-
Notifications
You must be signed in to change notification settings - Fork 0
/
.clang-format
99 lines (96 loc) · 3.06 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
88
89
90
91
92
93
94
95
96
97
98
99
# https://blog.csdn.net/softimite_zifeng/article/details/78357898
---
Language: Cpp
#BasedOnStyle: Google
AccessModifierOffset: -4
#AlignAfterOpenBracket: false
#AlignAfterOpenBracket: Align
AlignAfterOpenBracket: DontAlign
#AlignAfterOpenBracket: AlwaysBreak
# 控制 else 跟括号在不在一块
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html
#BreakBeforeBraces: Attach
BreakBeforeBraces: Custom
BraceWrapping:
BeforeElse: true
AlignConsecutiveAssignments: false
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
# if 判断可以在一行
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: true
ColumnLimit: 0
#ColumnLimit: 300
CommentPragmas: '^ IWYU pragma:'
#ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 4
# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always
UseTab: ForContinuationAndIndentation
# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响
#SpacesInSquareBrackets: true
# 对齐续航符位置
AlignEscapedNewlines: Left
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#AllowShortLambdasOnASingleLine: Empty
AllowShortLambdasOnASingleLine: Inline
FixNamespaceComments: true
#SBS_Never: Never
#CompactNamespaces: false
Standard: c++20
...