-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path.clang-format
More file actions
178 lines (172 loc) · 5.57 KB
/
.clang-format
File metadata and controls
178 lines (172 loc) · 5.57 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#
# Copyright 2021 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
Language: Cpp
# assumes clang-format 11 https://releases.llvm.org/11.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# which is available in Ubuntu 20.04 as clang-format-11
BasedOnStyle: Mozilla
AccessModifierOffset: -4
AlignAfterOpenBracket: DontAlign
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
#AlignConsecutiveBitFields: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
#AllowShortEnumsOnASingleLine: false
AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: true
BinPackParameters: false
BraceWrapping:
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
# AfterCaseLabel: true
# AfterClass: false
# AfterControlStatement: Never
# AfterEnum: false
# AfterFunction: false
# AfterNamespace: false
# AfterObjCDeclaration: false
# AfterStruct: false
# AfterUnion: false
# AfterExternBlock: false
# BeforeCatch: false
# BeforeElse: false
## BeforeLambdaBody: false
## BeforeWhile: false
# IndentBraces: false
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true
BreakBeforeTernaryOperators: false
BreakBeforeInheritanceComma: false
#BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
#BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 200
#CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
# ATTENTION:
# setting this option to a value other than 0 may cause the indentation
# to be unstable: multiple runs of the linter would keep changing
# the same file back and forth and loop between two different text layouts
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
#EmptyLineBeforeAccessModifier: Always
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
IncludeBlocks: Regroup
IncludeCategories:
#
# Extended Regular Expressions:
# https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html
#
# first match full path graphblas includes, but put them third
- Regex: '^([<|"]graphblas/)'
Priority: 1
SortPriority: 3
# then match standard includes (i.e. headers in <> without extension) and put them first
- Regex: '^<([A-Za-z0-9\Q/-_\E]+)>'
Priority: 2
SortPriority: 1
# then match standard headers starting with "std" and with extension and put them also in the first group
- Regex: '^<(std[A-Za-z0-9\Q/-_\E]*\.h)>'
Priority: 3
SortPriority: 1
# then match other headers in <> with extensions and put in the second group
- Regex: '^<([A-Za-z0-9.\Q/-_\E]+\.h[h|pp|xx]?)>'
Priority: 4
SortPriority: 2
# finally includes within "" and put them last
- Regex: '".*"'
Priority: 5
SortPriority: 4
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
#IndentCaseBlocks: false
IndentCaseLabels: true
#IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
#InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: All
PenaltyBreakAssignment: 100
PenaltyBreakBeforeFirstCallParameter: 5
PenaltyBreakComment: 1
PenaltyBreakFirstLessLess: 5
PenaltyBreakString: 1
PenaltyBreakTemplateDeclaration: 1
PenaltyExcessCharacter: 1000
PenaltyReturnTypeOnItsOwnLine: 20
PointerAlignment: Middle
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: true
SpacesInConditionalStatement: true
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: true
SpacesInSquareBrackets: true
SpaceBeforeSquareBrackets: false
Standard: c++11
TabWidth: 4
UseCRLF: false
UseTab: AlignWithSpaces
#WhitespaceSensitiveMacros:
# - STRINGIZE
# - PP_STRINGIZE