|
1 | 1 | --- |
2 | | -Language: Cpp |
3 | | -# BasedOnStyle: LLVM |
4 | | -AccessModifierOffset: -2 |
5 | | -AlignAfterOpenBracket: Align |
6 | | -AlignArrayOfStructures: None |
7 | | -AlignConsecutiveAssignments: |
8 | | - Enabled: false |
9 | | - AcrossEmptyLines: false |
10 | | - AcrossComments: false |
11 | | - AlignCompound: false |
12 | | - PadOperators: true |
13 | | -AlignConsecutiveBitFields: |
14 | | - Enabled: false |
15 | | - AcrossEmptyLines: false |
16 | | - AcrossComments: false |
17 | | - AlignCompound: false |
18 | | - PadOperators: false |
19 | | -AlignConsecutiveDeclarations: |
20 | | - Enabled: false |
21 | | - AcrossEmptyLines: false |
22 | | - AcrossComments: false |
23 | | - AlignCompound: false |
24 | | - PadOperators: false |
25 | | -AlignConsecutiveMacros: |
26 | | - Enabled: false |
27 | | - AcrossEmptyLines: false |
28 | | - AcrossComments: false |
29 | | - AlignCompound: false |
30 | | - PadOperators: false |
31 | | -AlignEscapedNewlines: Right |
32 | | -AlignOperands: Align |
33 | | -AlignTrailingComments: |
34 | | - Kind: Always |
35 | | - OverEmptyLines: 0 |
36 | | -AllowAllArgumentsOnNextLine: true |
37 | | -AllowAllParametersOfDeclarationOnNextLine: true |
38 | | -AllowShortBlocksOnASingleLine: Never |
39 | | -AllowShortCaseLabelsOnASingleLine: false |
40 | | -AllowShortEnumsOnASingleLine: true |
41 | | -AllowShortFunctionsOnASingleLine: All |
42 | | -AllowShortIfStatementsOnASingleLine: Never |
43 | | -AllowShortLambdasOnASingleLine: All |
44 | | -AllowShortLoopsOnASingleLine: false |
45 | | -AlwaysBreakAfterDefinitionReturnType: None |
46 | | -AlwaysBreakAfterReturnType: None |
47 | | -AlwaysBreakBeforeMultilineStrings: false |
48 | | -AlwaysBreakTemplateDeclarations: MultiLine |
49 | | -AttributeMacros: |
50 | | - - __capability |
51 | | -BinPackArguments: true |
52 | | -BinPackParameters: true |
53 | | -BitFieldColonSpacing: Both |
54 | | -BraceWrapping: |
55 | | - AfterCaseLabel: false |
56 | | - AfterClass: false |
57 | | - AfterControlStatement: Never |
58 | | - AfterEnum: false |
59 | | - AfterExternBlock: false |
60 | | - AfterFunction: false |
61 | | - AfterNamespace: false |
62 | | - AfterObjCDeclaration: false |
63 | | - AfterStruct: false |
64 | | - AfterUnion: false |
65 | | - BeforeCatch: false |
66 | | - BeforeElse: false |
67 | | - BeforeLambdaBody: false |
68 | | - BeforeWhile: false |
69 | | - IndentBraces: false |
70 | | - SplitEmptyFunction: true |
71 | | - SplitEmptyRecord: true |
72 | | - SplitEmptyNamespace: true |
73 | | -BreakAfterAttributes: Never |
74 | | -BreakAfterJavaFieldAnnotations: false |
75 | | -BreakArrays: true |
76 | | -BreakBeforeBinaryOperators: None |
77 | | -BreakBeforeConceptDeclarations: Always |
78 | | -BreakBeforeBraces: Attach |
79 | | -BreakBeforeInlineASMColon: OnlyMultiline |
80 | | -BreakBeforeTernaryOperators: true |
81 | | -BreakConstructorInitializers: BeforeColon |
82 | | -BreakInheritanceList: BeforeColon |
83 | | -BreakStringLiterals: true |
84 | | -ColumnLimit: 120 |
85 | | -CommentPragmas: "^ IWYU pragma:" |
86 | | -CompactNamespaces: false |
87 | | -ConstructorInitializerIndentWidth: 4 |
88 | | -ContinuationIndentWidth: 4 |
89 | | -Cpp11BracedListStyle: true |
90 | | -DerivePointerAlignment: false |
| 2 | +# SPDX-FileCopyrightText: 2019 Christoph Cullmann <cullmann@kde.org> |
| 3 | +# SPDX-FileCopyrightText: 2019 Gernot Gebhard <gebhard@absint.com> |
| 4 | +# |
| 5 | +# SPDX-License-Identifier: MIT |
| 6 | + |
| 7 | +# This file got automatically created by ECM, do not edit |
| 8 | +# See https://clang.llvm.org/docs/ClangFormatStyleOptions.html for the config options |
| 9 | +# and https://community.kde.org/Policies/Frameworks_Coding_Style#Clang-format_automatic_code_formatting |
| 10 | +# for clang-format tips & tricks |
| 11 | +--- |
| 12 | +Language: JavaScript |
| 13 | +DisableFormat: true |
| 14 | +--- |
| 15 | +Language: Json |
91 | 16 | DisableFormat: false |
92 | | -EmptyLineAfterAccessModifier: Never |
93 | | -EmptyLineBeforeAccessModifier: LogicalBlock |
94 | | -ExperimentalAutoDetectBinPacking: false |
95 | | -FixNamespaceComments: true |
96 | | -ForEachMacros: |
97 | | - - foreach |
98 | | - - Q_FOREACH |
99 | | - - BOOST_FOREACH |
100 | | -IfMacros: |
101 | | - - KJ_IF_MAYBE |
102 | | -IncludeBlocks: Preserve |
103 | | -IncludeCategories: |
104 | | - - Regex: '^"(llvm|llvm-c|clang|clang-c)/' |
105 | | - Priority: 2 |
106 | | - SortPriority: 0 |
107 | | - CaseSensitive: false |
108 | | - - Regex: '^(<|"(gtest|gmock|isl|json)/)' |
109 | | - Priority: 3 |
110 | | - SortPriority: 0 |
111 | | - CaseSensitive: false |
112 | | - - Regex: ".*" |
113 | | - Priority: 1 |
114 | | - SortPriority: 0 |
115 | | - CaseSensitive: false |
116 | | -IncludeIsMainRegex: "(Test)?$" |
117 | | -IncludeIsMainSourceRegex: "" |
118 | | -IndentAccessModifiers: false |
119 | | -IndentCaseBlocks: false |
120 | | -IndentCaseLabels: false |
121 | | -IndentExternBlock: AfterExternBlock |
122 | | -IndentGotoLabels: true |
123 | | -IndentPPDirectives: None |
124 | | -IndentRequiresClause: true |
125 | 17 | IndentWidth: 4 |
126 | | -IndentWrappedFunctionNames: false |
127 | | -InsertBraces: false |
128 | | -InsertNewlineAtEOF: false |
129 | | -InsertTrailingCommas: None |
130 | | -IntegerLiteralSeparator: |
131 | | - Binary: 0 |
132 | | - BinaryMinDigits: 0 |
133 | | - Decimal: 0 |
134 | | - DecimalMinDigits: 0 |
135 | | - Hex: 0 |
136 | | - HexMinDigits: 0 |
137 | | -JavaScriptQuotes: Leave |
138 | | -JavaScriptWrapImports: true |
139 | | -KeepEmptyLinesAtTheStartOfBlocks: true |
140 | | -LambdaBodyIndentation: Signature |
141 | | -LineEnding: DeriveLF |
142 | | -MacroBlockBegin: "" |
143 | | -MacroBlockEnd: "" |
144 | | -MaxEmptyLinesToKeep: 1 |
145 | | -NamespaceIndentation: None |
146 | | -ObjCBinPackProtocolList: Auto |
147 | | -ObjCBlockIndentWidth: 2 |
148 | | -ObjCBreakBeforeNestedBlockParam: true |
149 | | -ObjCSpaceAfterProperty: false |
150 | | -ObjCSpaceBeforeProtocolList: true |
151 | | -PackConstructorInitializers: BinPack |
152 | | -PenaltyBreakAssignment: 2 |
153 | | -PenaltyBreakBeforeFirstCallParameter: 19 |
154 | | -PenaltyBreakComment: 300 |
155 | | -PenaltyBreakFirstLessLess: 120 |
156 | | -PenaltyBreakOpenParenthesis: 0 |
157 | | -PenaltyBreakString: 1000 |
158 | | -PenaltyBreakTemplateDeclaration: 10 |
159 | | -PenaltyExcessCharacter: 1000000 |
160 | | -PenaltyIndentedWhitespace: 0 |
161 | | -PenaltyReturnTypeOnItsOwnLine: 60 |
| 18 | +--- |
| 19 | + |
| 20 | +# Style for C++ |
| 21 | +Language: Cpp |
| 22 | + |
| 23 | +# base is WebKit coding style: https://webkit.org/code-style-guidelines/ |
| 24 | +# below are only things set that diverge from this style! |
| 25 | +BasedOnStyle: WebKit |
| 26 | + |
| 27 | +# enforce C++11 (e.g. for std::vector<std::vector<lala>> |
| 28 | +Standard: Cpp11 |
| 29 | + |
| 30 | +# 4 spaces indent |
| 31 | +TabWidth: 4 |
| 32 | + |
| 33 | +# 2 * 80 wide lines |
| 34 | +ColumnLimit: 160 |
| 35 | + |
| 36 | +# sort includes inside line separated groups |
| 37 | +SortIncludes: true |
| 38 | + |
| 39 | +# break before braces on function, namespace and class definitions. |
| 40 | +BreakBeforeBraces: Linux |
| 41 | + |
| 42 | +# CrlInstruction *a; |
162 | 43 | PointerAlignment: Right |
163 | | -PPIndentWidth: -1 |
164 | | -QualifierAlignment: Leave |
165 | | -ReferenceAlignment: Pointer |
166 | | -ReflowComments: true |
167 | | -RemoveBracesLLVM: false |
168 | | -RemoveSemicolon: false |
169 | | -RequiresClausePosition: OwnLine |
170 | | -RequiresExpressionIndentation: OuterScope |
171 | | -SeparateDefinitionBlocks: Leave |
172 | | -ShortNamespaceLines: 1 |
173 | | -SortIncludes: CaseSensitive |
174 | | -SortJavaStaticImport: Before |
175 | | -SortUsingDeclarations: LexicographicNumeric |
176 | | -SpaceAfterCStyleCast: false |
177 | | -SpaceAfterLogicalNot: false |
178 | | -SpaceAfterTemplateKeyword: true |
179 | | -SpaceAroundPointerQualifiers: Default |
180 | | -SpaceBeforeAssignmentOperators: true |
181 | | -SpaceBeforeCaseColon: false |
| 44 | + |
| 45 | +# horizontally aligns arguments after an open bracket. |
| 46 | +AlignAfterOpenBracket: Align |
| 47 | + |
| 48 | +# don't move all parameters to new line |
| 49 | +AllowAllParametersOfDeclarationOnNextLine: false |
| 50 | + |
| 51 | +# no single line functions |
| 52 | +AllowShortFunctionsOnASingleLine: None |
| 53 | + |
| 54 | +# no single line enums |
| 55 | +AllowShortEnumsOnASingleLine: false |
| 56 | + |
| 57 | +# always break before you encounter multi line strings |
| 58 | +AlwaysBreakBeforeMultilineStrings: true |
| 59 | + |
| 60 | +# don't move arguments to own lines if they are not all on the same |
| 61 | +BinPackArguments: false |
| 62 | + |
| 63 | +# don't move parameters to own lines if they are not all on the same |
| 64 | +BinPackParameters: false |
| 65 | + |
| 66 | +# In case we have an if statement with multiple lines the operator should be at the beginning of the line |
| 67 | +# but we do not want to break assignments |
| 68 | +BreakBeforeBinaryOperators: NonAssignment |
| 69 | + |
| 70 | +# format C++11 braced lists like function calls |
| 71 | +Cpp11BracedListStyle: true |
| 72 | + |
| 73 | +# do not put a space before C++11 braced lists |
182 | 74 | SpaceBeforeCpp11BracedList: false |
183 | | -SpaceBeforeCtorInitializerColon: true |
184 | | -SpaceBeforeInheritanceColon: true |
185 | | -SpaceBeforeParens: ControlStatements |
186 | | -SpaceBeforeParensOptions: |
187 | | - AfterControlStatements: true |
188 | | - AfterForeachMacros: true |
189 | | - AfterFunctionDefinitionName: false |
190 | | - AfterFunctionDeclarationName: false |
191 | | - AfterIfMacros: true |
192 | | - AfterOverloadedOperator: false |
193 | | - AfterRequiresInClause: false |
194 | | - AfterRequiresInExpression: false |
195 | | - BeforeNonEmptyParentheses: false |
196 | | -SpaceBeforeRangeBasedForLoopColon: true |
197 | | -SpaceBeforeSquareBrackets: false |
198 | | -SpaceInEmptyBlock: false |
199 | | -SpaceInEmptyParentheses: false |
200 | | -SpacesBeforeTrailingComments: 1 |
201 | | -SpacesInAngles: Never |
202 | | -SpacesInConditionalStatement: false |
203 | | -SpacesInContainerLiterals: true |
204 | | -SpacesInCStyleCastParentheses: false |
205 | | -SpacesInLineCommentPrefix: |
206 | | - Minimum: 1 |
207 | | - Maximum: -1 |
208 | | -SpacesInParentheses: false |
209 | | -SpacesInSquareBrackets: false |
210 | | -Standard: Latest |
211 | | -StatementAttributeLikeMacros: |
212 | | - - Q_EMIT |
213 | | -StatementMacros: |
214 | | - - Q_UNUSED |
215 | | - - QT_REQUIRE_VERSION |
216 | | -TabWidth: 8 |
217 | | -UseTab: Never |
218 | | -WhitespaceSensitiveMacros: |
219 | | - - BOOST_PP_STRINGIZE |
220 | | - - CF_SWIFT_NAME |
221 | | - - NS_SWIFT_NAME |
222 | | - - PP_STRINGIZE |
223 | | - - STRINGIZE |
224 | | ---- |
225 | 75 |
|
| 76 | +# remove empty lines |
| 77 | +KeepEmptyLinesAtTheStartOfBlocks: false |
| 78 | + |
| 79 | +# no namespace indentation to keep indent level low |
| 80 | +NamespaceIndentation: None |
| 81 | + |
| 82 | +# we use template< without space. |
| 83 | +SpaceAfterTemplateKeyword: false |
| 84 | + |
| 85 | +# Always break after template declaration |
| 86 | +AlwaysBreakTemplateDeclarations: true |
| 87 | + |
| 88 | +# macros for which the opening brace stays attached. |
| 89 | +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE , wl_resource_for_each, wl_resource_for_each_safe ] |
| 90 | + |
| 91 | +# keep lambda formatting multi-line if not empty |
| 92 | +AllowShortLambdasOnASingleLine: Empty |
| 93 | + |
| 94 | +# We do not want clang-format to put all arguments on a new line |
| 95 | +AllowAllArgumentsOnNextLine: false |
0 commit comments