Fix: Assert in USD curves reader offset creation
[blender.git] / .clang-format
blob87972abadfaa4a8542d59d2784a9a55d8a6e2373
2 # Configuration of clang-format
3 # =============================
5 # Tested to work with versions: 8 to 11.
7 # This causes parameters on continuations to align to the opening brace.
9 #   like_this_long_name(parameter_one,
10 #                       parameter_two,
11 #                       parameter_three);
13 AlignAfterOpenBracket: 'Align'
15 # Disallow short functions on one line; break them up.
16 AllowShortBlocksOnASingleLine: false
18 # These two settings trigger stacking of parameters in most cases; this is
19 # easier to read and also makes diffs easier to read (since an added or removed
20 # parameter is obvious). For example, function calls will look like this:
22 #   like_this_long_name(parameter_one,
23 #                       parameter_two,
24 #                       parameter_three,
25 #                       parameter_four,
26 #                       parameter_five,
27 #                       parameter_six);
29 # Instead of:
31 #   like_this_long_name(parameter_one, parameter_two, parameter_three, parameter_four,
32 #                       parameter_five, parameter_six);
34 BinPackArguments: false
35 BinPackParameters: false
37 # Line width (don't exceed 100).
38 ColumnLimit: 99
40 # Cause initializer lists to have one member initialized per line, in the case
41 # that all initializers can't fit on a single line.
42 ConstructorInitializerAllOnOneLineOrOnePerLine: true
44 # Indent the : after a constructor. For example:
46 #   explicit foo_class ()
47 #       : member1_(5)
48 #   {
49 #   }
51 ConstructorInitializerIndentWidth: 4
53 # Make access modifier slightly more visible.
54 AccessModifierOffset: -1
56 # This will unfortunately use spaces in some cases where it's not desired (like
57 # function calls) but the overall result is better since it will allow
58 # alignment to work properly with different tab width settings.
59 ContinuationIndentWidth: 4
61 # This tries to match Blender's style as much as possible. One
62 BreakBeforeBraces: Custom
63 BraceWrapping: {
64     AfterClass: 'false',
65     AfterControlStatement: 'MultiLine',
66     AfterEnum : 'false',
67     AfterFunction : 'true',
68     AfterNamespace : 'false',
69     AfterStruct : 'false',
70     AfterUnion : 'false',
71     BeforeCatch : 'true',
72     BeforeElse : 'true',
73     IndentBraces : 'false',
74     AfterObjCDeclaration: 'true',
77 # For switch statements, indent the cases.
78 IndentCaseLabels: true
80 # Indent after the hash inside preprocessor directives
81 IndentPPDirectives: AfterHash
83 BreakBeforeTernaryOperators: false
85 SpaceAfterTemplateKeyword: false
87 # Handy comment at the end of each C++ name space.
88 FixNamespaceComments: true
90 # Use "if (...)" instead of "if(...)", but have function calls like foo().
91 SpaceBeforeParens: ControlStatements
92 SpaceInEmptyParentheses: false
94 # Use two spaces before trailing comments, for example
96 #   foo = bar;  // comment
98 # Note that this doesn't work for C-style comments.
99 SpacesBeforeTrailingComments: 2
101 # Reflow comments, developers must disable formatting as with code to override this.
102 ReflowComments: true
104 # Never use tabs for indentation.
105 # Note: TabWidth and IndentWidth must be the same, or strange things happen.
106 UseTab: Never
107 TabWidth: 2
108 IndentWidth: 2
110 # Add a big penalty on breaking after the return type of functions. For example,
112 #   static void foo(...)
114 # Instead of:
116 #   static void
117 #   foo(very long content here that maybe could be stacked)
119 PenaltyReturnTypeOnItsOwnLine: 10000
121 # Avoid having function calls broken onto a new line:
123 #   int a = foo(
124 #       long, list, of, many, params);
126 # Instead of:
128 #   int a =
129 #       foo(long, list, of, many, params);
131 PenaltyBreakAssignment: 100
133 AllowShortFunctionsOnASingleLine: Empty
135 SortIncludes: true
137 # Don't right align escaped newlines to the right because we have a wide default
138 AlignEscapedNewlines: DontAlign
140 # Always break:
142 #   const char *foo =
143 #       "multi"
144 #       "line";
146 # Instead of:
148 #   const char *foo = "multi"
149 #                     "line";
151 AlwaysBreakBeforeMultilineStrings: true
153 # We don't want literal strings to break,
154 # however clang-format seems to ignore this (sigh).
155 PenaltyBreakString: 1000000
157 # There are macros in Blender for custom for loops; tell Clang to treat them
158 # like loops rather than an expression, and so put the { on the same line.
160 # To find these use multi-line regex search:
161 # "^\s+[A-Z][A-Z0-9_]+\s*\([^\n]*\)\n\s*\{"
162 ForEachMacros:
163   - BEGIN_ANIMFILTER_SUBCHANNELS
164   - BKE_pbvh_vertex_iter_begin
165   - BKE_pbvh_face_iter_begin
166   - BLI_FOREACH_SPARSE_RANGE
167   - BLI_SMALLSTACK_ITER_BEGIN
168   - BMO_ITER
169   - BMO_ITER_INDEX
170   - BMW_ITER
171   - BM_FACES_OF_VERT_ITER_BEGIN
172   - BM_ITER_BPY_BM_SEQ
173   - BM_ITER_ELEM
174   - BM_ITER_ELEM_INDEX
175   - BM_ITER_MESH
176   - BM_ITER_MESH_INDEX
177   - BM_ITER_MESH_MUTABLE
178   - BM_LOOPS_OF_VERT_ITER_BEGIN
179   - BOOST_FOREACH
180   - CTX_DATA_BEGIN
181   - CTX_DATA_BEGIN_WITH_ID
182   - DEG_OBJECT_ITER_BEGIN
183   - DEG_OBJECT_ITER_FOR_RENDER_ENGINE_BEGIN
184   - DRW_ENABLED_ENGINE_ITER
185   - DRIVER_TARGETS_LOOPER_BEGIN
186   - DRIVER_TARGETS_USED_LOOPER_BEGIN
187   - FOREACH_BASE_IN_EDIT_MODE_BEGIN
188   - FOREACH_BASE_IN_MODE_BEGIN
189   - FOREACH_BEGIN
190   - FOREACH_COLLECTION_BEGIN
191   - FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN
192   - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN
193   - FOREACH_EDIT_OBJECT_BEGIN
194   - FOREACH_MAIN_ID_BEGIN
195   - FOREACH_MAIN_LISTBASE_BEGIN
196   - FOREACH_MAIN_LISTBASE_ID_BEGIN
197   - FOREACH_MESH_BUFFER_CACHE
198   - FOREACH_NODETREE_BEGIN
199   - FOREACH_OBJECT_BEGIN
200   - FOREACH_OBJECT_FLAG_BEGIN
201   - FOREACH_OBJECT_IN_EDIT_MODE_BEGIN
202   - FOREACH_OBJECT_IN_MODE_BEGIN
203   - FOREACH_OBJECT_RENDERABLE_BEGIN
204   - FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN
205   - FOREACH_PCHAN_VISIBLE_IN_OBJECT_BEGIN
206   - FOREACH_SCENE_COLLECTION_BEGIN
207   - FOREACH_SCENE_OBJECT_BEGIN
208   - FOREACH_SELECTED_BASE_BEGIN
209   - FOREACH_SELECTED_BEZT_BEGIN
210   - FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN
211   - FOREACH_SELECTED_OBJECT_BEGIN
212   - FOREACH_TRANS_DATA_CONTAINER
213   - FOREACH_VIEW_LAYER_TO_RENDER_BEGIN
214   - FOREACH_VISIBLE_BASE_BEGIN
215   - FOREACH_VISIBLE_OBJECT_BEGIN
216   - GHASH_FOREACH_BEGIN
217   - GHASH_ITER
218   - GHASH_ITER_INDEX
219   - GPU_SELECT_LOAD_IF_PICKSEL_LIST
220   - GP_EDITABLE_STROKES_BEGIN
221   - GP_EVALUATED_STROKES_BEGIN
222   - GSET_FOREACH_BEGIN
223   - GSET_ITER
224   - GSET_ITER_INDEX
225   - ITER_BEGIN
226   - ITER_PIXELS
227   - ITER_SLOTS
228   - ITER_SLOTS_BEGIN
229   - LOOP_EDITED_POINTS
230   - LOOP_KEYS
231   - LOOP_POINTS
232   - LOOP_SELECTED_KEYS
233   - LOOP_SELECTED_POINTS
234   - LOOP_TAGGED_KEYS
235   - LOOP_TAGGED_POINTS
236   - LOOP_UNSELECTED_POINTS
237   - LOOP_VISIBLE_KEYS
238   - LOOP_VISIBLE_POINTS
239   - LIGHT_FOREACH_BEGIN_DIRECTIONAL
240   - LIGHT_FOREACH_BEGIN_LOCAL
241   - LISTBASE_CIRCULAR_BACKWARD_BEGIN
242   - LISTBASE_CIRCULAR_FORWARD_BEGIN
243   - LISTBASE_FOREACH
244   - LISTBASE_FOREACH_BACKWARD
245   - LISTBASE_FOREACH_MUTABLE
246   - LISTBASE_FOREACH_BACKWARD_MUTABLE
247   - LISTBASE_FOREACH_INDEX
248   - MAN_ITER_AXES_BEGIN
249   - NODE_INSTANCE_HASH_ITER
250   - NODE_SOCKET_TYPES_BEGIN
251   - NODE_TREE_TYPES_BEGIN
252   - NODE_TYPES_BEGIN
253   - PIXEL_LOOPER_BEGIN
254   - PIXEL_LOOPER_BEGIN_CHANNELS
255   - RENDER_PASS_ITER_BEGIN
256   - RNA_BEGIN
257   - RNA_PROP_BEGIN
258   - RNA_STRUCT_BEGIN
259   - RNA_STRUCT_BEGIN_SKIP_RNA_TYPE
260   - SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN
261   - SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN
262   - SEQ_ALL_BEGIN
263   - SEQ_ITERATOR_FOREACH
264   - SURFACE_QUAD_ITER_BEGIN
265   - foreach
266   - ED_screen_areas_iter
267   - SLOT_PROBING_BEGIN
268   - SET_SLOT_PROBING_BEGIN
269   - MAP_SLOT_PROBING_BEGIN
270   - VECTOR_SET_SLOT_PROBING_BEGIN
271   - WL_ARRAY_FOR_EACH
272   - FOREACH_SPECTRUM_CHANNEL
274 StatementMacros:
275   - PyObject_HEAD
276   - PyObject_VAR_HEAD
277   - ccl_gpu_kernel_postfix
279 MacroBlockBegin: "^OSL_CLOSURE_STRUCT_BEGIN$"
280 MacroBlockEnd: "^OSL_CLOSURE_STRUCT_END$"
282 # Ensure single new line at the end of source files.
283 InsertNewlineAtEOF: True
284 KeepEmptyLinesAtEOF: False