-
Notifications
You must be signed in to change notification settings - Fork 1
/
.clang-format
139 lines (132 loc) · 3.72 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# This file is part of the Zephir.
#
# (c) Phalcon Team <[email protected]>
#
# For the full copyright and license information, please view
# the LICENSE file that was distributed with this source code.
# Zephir clang-format configuration file
# Please seek consensus from the Zephir team before modifying this file.
#
#
# See also:
# https://google.github.io/styleguide/cppguide.html#
#
# To compare these settings with all available clang-format options:
# diff <(clang-format -dump-config | grep -Ev '^$|^( |BraceWrapping|IncludeCategories)' | sed -Ee 's/: +/: /g' | sort) <(cat .clang-format | grep -Ev '^$|^#' | sort) | colordiff
#
---
DisableFormat: false
Language: Cpp
Standard: Auto
# Indentation & whitespace
AccessModifierOffset: -1
ColumnLimit: 80
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
SpacesBeforeTrailingComments: 2
TabWidth: 8
UseTab: Never
# Spacing style
Cpp11BracedListStyle: true
DerivePointerAlignment: true
PointerAlignment: Left
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: true
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeRangeBasedForLoopColon: true
# Comments
AlignTrailingComments: true
CommentPragmas: '^ IWYU pragma:'
FixNamespaceComments: true
ReflowComments: true
# Pattern-based special behavior
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*\.hpp>'
Priority: 3
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 4
MacroBlockBegin: ''
MacroBlockEnd: ''
SortUsingDeclarations: true
SortIncludes: true
IncludeBlocks: Regroup
IncludeIsMainRegex: '([-_](test|unittest))?$'
CompactNamespaces: false
# Alignment & breaking
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: true
ExperimentalAutoDetectBinPacking: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakStringLiterals: true
ConstructorInitializerAllOnOneLineOrOnePerLine: true
BreakInheritanceList: BeforeColon
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
...
# Local Variables:
# mode: yaml
# tab-width: 2
# indent-tabs-mode: nil
# End: