-
Notifications
You must be signed in to change notification settings - Fork 0
/
.uncrustify
2668 lines (2129 loc) · 104 KB
/
.uncrustify
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Uncrustify_d-0.75.0-48-f5e4c569
### Special settings
sp_cpp_cast_paren = remove
## These are for functionality I added to uncrustify for SMHasher3
ls_split_balanced = true
ls_func_split_balanced = true
ls_func_split_outer = true
sp_func_call_inside_fparen = remove
sp_defined_inside_fparen = remove
sp_cmt_cpp_region_str = "--------"
sp_after_case_colon = force
nl_before_func_class_proto_group = 2
nl_before_func_body_proto_group = 2
nl_inside_func_body_proto_group = 2
align_punctuators_span = 4 # bad in pearson
align_case_colon = true
align_case_colon_gap = 0
align_case_label_default = false
align_case_label_number_right = true
align_same_func_call_commas = true
align_same_func_call_trailers = true
align_same_func_mix_var_defs = false
indent_case_unbraced_body = true
pp_indent_continue = 4
cmt_multi_nl_start = true
cmt_multi_nl_end = true
# Make REGISTER_HASH() and REGISTER_FAMILY() be "user functions"
# so that uncrustify doesn't try reformatting them as aggressively
set FUNC_CALL_USER REGISTER_HASH
set FUNC_CALL_USER REGISTER_FAMILY
sp_func_call_user_paren = remove
sp_func_call_user_inside_fparen = ignore
sp_func_call_user_paren_paren = ignore
================================
### pp parsing not working
### Way too hard to fix
## Intrinsics.h
### Enhance to force split on format strings
### WAT
### Bug in determining fcn boundary
### Likely ignorable (rare)
## Blobsort.cpp
#template <typename T, typename ... More>
#typename std::enable_if<!std::is_integral<T>::value, bool>::type
#
#static AND( bool in ) {
# return test_blobsort_type<T>() && AND<More...>(in);
#}
### UNIT TEST
## Blob.h
# Blob( uint64_t x ) :
#
# Blob((x = COND_BSWAP( x, isBE()), &x), sizeof(x)) {}
### UNIT TEST
## Blob.h
#public:
# //----------
# // constructors
#### This newline gets removed
# Blob() {
#
### Enhance to add mod_add_long_ifdef_elif_comment
### Enhance to accumulate #if texts
#mod_add_long_ifdef_elif_comment = 8
## This project generally subscribes to the One True Brace Style (1TBS).
## https://en.wikipedia.org/wiki/Indent_style#Variant:_1TBS_(OTBS)
## It combines maximum efficiency and maximum safety.
## My understanding of the traditional 1TBS is that opening braces for
## functions (and thus, in C++, classes, namespaces, and the like)
## should be on their own line (see the man page for astyle). While
## this made complete sense when C used K&R syntax for function
## declarations, it makes less sense with modern C/C++ declaration
## syntax, and so it is dropped here.
## Why, yes, I *do* see the irony that there are so many disagreements
## about the "One True Brace Style" entails....
### Enhance to not consider section header part of fn (for NL counting)
#### Enhance for opposite option
# Whether to change cpp-comments into c-comments.
cmt_cpp_to_c = false # true/false
### Enhance to reflow only some comments (not top-of-file?)
### Enhance to redo #ifdef => #if defined
### Enhance to right-align bool values???
### Enhance comment wrapping to not suck
### General settings
# Use UNIX line endings
newlines = lf
# Assume UTF-8, but don't use BOM
utf8_bom = remove
utf8_byte = true
utf8_force = false # I think?
# The number of columns to indent per level.
indent_columns = 4
# Try to limit code width to N columns.
code_width = 120 # unsigned number
# Whether to split lines as close to code_width as possible and ignore some groupings.
ls_code_width = false
### Comment settings
# Whether to put an empty '/*' on the first line of the combined c-comment.
cmt_c_nl_start = true
# Whether to add a newline before the closing '*/' of the combined c-comment.
cmt_c_nl_end = true
# Whether to put a star on subsequent comment lines.
cmt_star_cont = true
# The number of spaces to insert at the start of subsequent comment lines.
cmt_sp_before_star_cont = 0
# The number of spaces to insert after the star on subsequent comment lines.
cmt_sp_after_star_cont = 0
# Whether to change trailing, single-line c-comments into cpp-comments.
# This option is broken!!!
cmt_trailing_single_line_c_to_cpp = false
# Whether to group c-comments that look like they are in a block.
cmt_c_group = false # true/false
# Add or remove space after the opening of a C++ comment, as in '// <here> A'.
sp_cmt_cpp_start = add
# Add or remove space in a C++ region marker comment, as in '// <here> BEGIN'.
# A region marker is defined as a comment which is not preceded by other text
# (i.e. the comment is the first non-whitespace on the line), and which starts
# with either 'BEGIN' or 'END'.
#
# Overrides sp_cmt_cpp_start.
sp_cmt_cpp_region = remove
### Bracing options
# Add or remove braces on a single-line 'do' statement.
mod_full_brace_do = add
# Add or remove braces on a single-line 'for' statement.
mod_full_brace_for = add
# Add or remove braces on a single-line 'if' statement.
mod_full_brace_if = add
# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain.
# If true, mod_full_brace_if_chain will only remove braces from an 'if' that
# does not have an 'else if' or 'else'.
mod_full_brace_if_chain_only = true
# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either
# have, or do not have, braces.
# 0: Don't override mod_full_brace_if
mod_full_brace_if_chain = 0
# Add or remove braces on single-line 'while' statement.
mod_full_brace_while = add
# Add or remove braces on single-line 'using ()' statement.
mod_full_brace_using = add
### Expression options
# Whether to fully parenthesize Boolean expressions in 'while' and 'if'
# statement, as in 'if (a && b > c)' => 'if (a && (b > c))'.
mod_full_paren_if_bool = true
# Whether to fully parenthesize Boolean expressions after '='
# statement, as in 'x = a && b > c;' => 'x = (a && (b > c));'.
mod_full_paren_assign_bool = false
# Whether to fully parenthesize Boolean expressions in return,
# as in 'return a && b > c;' => 'return (a && (b > c));'.
mod_full_paren_return_bool = false
### Spacing options
## Use spaces always and tabs never, I guess...
# Whether to keep non-indenting tabs.
align_keep_tabs = false
# Whether to use tabs for aligning.
align_with_tabs = false
# Whether to convert all tabs to spaces in comments.
cmt_convert_tab_to_spaces = true # true/false
# Whether to keep whitespace not required for alignment.
align_keep_extra_space = false
# Whether to bump out to the next tab when aligning.
align_on_tabstop = false
## Maybe some/all of these 'add's should be 'force's?
## Whitespace within a line is generally good.
## Whitespace between separate, mutable things is very good.
## Whitespace between things that are tightly bound is bad.
# Force one space between a type and a word in declarations
sp_after_type = force
# Force one space between '}' and the name of a typedef on the same line.
sp_brace_typedef = force
# Remove space after C-style cast
sp_after_cast = remove
# Remove spaces inside cast parentheses
sp_inside_paren_cast = remove
# Undocumented?
sp_before_assign = force
# Add space around non-assignment symbolic operators ('+', '/', '%', '<<', and so forth).
sp_arith = add
sp_arith_additive = add
# Add space around assignment operator '=', '+=', etc.
sp_assign = add
# Add space around assignment operator '=' in a prototype.
sp_assign_default = add
# Add space in 'enum {'.
sp_enum_brace = add
# Add space around assignment '=' in enum.
sp_enum_assign = add
# Add space around boolean operators '&&' and '||'.
sp_bool = add
# Add space around compare operator '<', '>', '==', etc.
sp_compare = add
# Add or remove space before pointer star '*'.
sp_before_ptr_star = add
# Add or remove space between pointer stars '*', as in 'int ***a;'.
sp_between_ptr_star = remove
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star = add
# Add or remove space after a pointer star '*', if followed by an open
# parenthesis, as in 'void* (*)()'.
sp_ptr_star_paren = add
# Add or remove space before a reference sign '&'.
sp_before_byref = add
# Add or remove space after 'new', 'delete' and 'delete[]'.
sp_after_new = add
# Add or remove space around the ':' in 'b ? t : f'.
sp_cond_colon = add
sp_cond_colon_before = add
sp_cond_colon_after = add
# Add or remove space around the '?' in 'b ? t : f'.
sp_cond_question = add
sp_cond_question_before = add
sp_cond_question_after = add
# In the abbreviated ternary form '(a ?: b)', add or remove space between '?'
# and ':'.
sp_cond_ternary_short = remove
# Add or remove space before ':' in a Java/C++11 range-based 'for',
# as in 'for (Type var <here> : expr)'.
sp_before_for_colon = remove
# Add or remove space after ':' in a Java/C++11 range-based 'for',
# as in 'for (Type var : <here> expr)'.
sp_after_for_colon = add
# Remove space after the '!' (not) unary operator.
sp_not = remove
# Add or remove space between two '!' (not) unary operators.
sp_not_not = remove
# Add or remove space after the '~' (invert) unary operator.
sp_inv = remove
# Add or remove space after the '&' (address-of) unary operator.
sp_addr = remove
# Add or remove space around the '.' or '->' operators.
sp_member = remove
# Add or remove space after the '*' (dereference) unary operator.
sp_deref = remove
# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'.
sp_sign = remove
# Add or remove space between '++' and '--' the word to which it is being
# applied, as in '(--x)' or 'y++;'.
sp_incdec = remove
## Parens are already visually explicit, so more whitespace
## isn't needed.
# Remove space inside '(' and ')'.
sp_inside_paren = remove
# Remove space between nested parentheses, i.e. '((' vs. ') )'.
sp_paren_paren = remove
# Whether to balance spaces inside nested parentheses.
sp_balance_nested_parens = false
## Similarly with semi-colons.
# Remove space before ';'.
sp_before_semi = remove
# Remove space after ';', except when followed by a comment.
sp_after_semi = add
## Treat angle brackets and all the things inside them as a single
## (large, complicated) type
# Add space between 'template' and '<'.
sp_template_angle = add
# Add space after '>'.
sp_after_angle = add
# Add space between '>' and ':'.
sp_angle_colon = add
# Add space between '>' and a word as in 'List<byte> m;' or
# 'template <typename T> static ...'.
sp_angle_word = add
# Remove space between '>' and '>' in '>>'.
# Since C++11 is guaranteed, the space isn't needed.
sp_permit_cpp11_shift = true
sp_angle_shift = remove
# Remove space inside '<' and '>'.
sp_inside_angle = remove
# Remove space inside '<>'.
sp_inside_angle_empty = remove
# Remove space between '>' and '(' as found in 'new List<byte>(foo);'.
sp_angle_paren = remove
# Remove space between '>' and '()' as found in 'new List<byte>();'.
sp_angle_paren_empty = remove
# Add or remove space before '<'.
sp_before_angle = remove # ignore/add/remove/force/not_defined
# Add or remove space inside '{' and '}'.
sp_inside_braces = add
# Add or remove space inside '{}'.
sp_inside_braces_empty = remove
# Add space before '(' of control statements ('if', 'for', 'switch',
# 'while', etc.).
sp_before_sparen = add
# Remove space inside '(' and ')' of control statements.
sp_inside_sparen = remove
sp_inside_for = remove
sp_sparen_paren = remove
# Remove space after ')' of control statements.
sp_after_sparen = remove
# Add space between ')' and '{' of control statements.
sp_sparen_brace = add
# Add space between 'do' and '{'.
sp_do_brace_open = add
# Add space between '}' and 'while'.
sp_brace_close_while = add
# Add space between 'while' and '('.
sp_while_paren_open = add
# Remove space before ';' in non-empty 'for' statements.
sp_before_semi_for = remove
# Remove space before a semicolon of an empty left part of a for statement
sp_before_semi_for_empty = remove
# Remove space between the semicolons of an empty middle part of a for statement
sp_between_semi_for_empty = remove
# Remove space after the final semicolon of an empty part of a for statement
sp_after_semi_for_empty = remove
# Force exactly one space after ';' in non-empty 'for' statements
sp_after_semi_for = force
# Force exactly one space between 'else' and '{' if on the same line.
sp_else_brace = force
# Force exactly one space between '}' and 'else' if on the same line.
sp_brace_else = force
# Whether to fully split long 'for' statements at semi-colons.
ls_for_split_full = false
# Add or remove space before case ':'.
sp_before_case_colon = remove
# Fix the spacing between 'case' and the label.
sp_case_label = force
# Whether to move a 'return' that appears after a fully braced 'case' before
# the close brace, as in 'case X: { ... } return;' => 'case X: { ... return; }'.
mod_move_case_return = false
## Comma operator works like English comma. It joins with thing before
## it, and space comes after it.
# Add or remove space after ',', i.e. 'a,b' vs. 'a, b'.
sp_after_comma = add
# Add or remove space before ',', i.e. 'a,b' vs. 'a ,b'.
sp_before_comma = remove
# Add or remove space between 'sizeof' and '('.
sp_sizeof_paren = remove
# Add or remove space between 'sizeof' and '...'.
sp_sizeof_ellipsis = remove
# Add or remove space between 'sizeof...' and '('.
sp_sizeof_ellipsis_paren = remove
## Function declaration and definitions
# Add or remove space between function name and '(' on function declaration.
sp_func_proto_paren = remove
sp_func_proto_paren_empty = remove
# Add or remove space inside function '(' and ')'.
sp_inside_fparen = add
# Add or remove space between ')' and '{' of function.
sp_fparen_brace = force
# Add or remove space between return type and function name.
sp_type_func = force
# Whether to fully split long function prototypes/calls at commas.
ls_func_split_full = false
# The number of newlines before a function prototype.
nl_before_func_body_proto = 1
# The number of newlines before a multi-line function definition.
# This option can be overridden with eat_blanks_after_open_brace=true.
nl_before_func_body_def = 2
# The number of newlines after a function prototype.
nl_after_func_proto = 1
# The number of newlines after a function prototype, if not followed by
# another function prototype.
nl_after_func_proto_group = 2
# The number of newlines after '}' of a multi-line function body.
nl_after_func_body = 2
# The number of newlines after '}' of a single line function body. Also
# affects class constructors/destructors.
# Overrides nl_after_func_body and nl_after_func_body_class.
nl_after_func_body_one_liner = 2
# Add or remove space after 'return'.
sp_return = force
sp_return_paren = force
sp_return_brace = force
## Function use
# Add or remove space between function name and '(' on function calls.
sp_func_call_paren = remove
sp_func_call_paren_empty = remove
# Add or remove space between a constructor/destructor and the open
# parenthesis.
sp_func_class_paren = remove
sp_func_class_paren_empty = remove
## Declaration-y stuff
# Add or remove space after class constructor ':'.
sp_after_constr_colon = add
# Add or remove space before class constructor ':'.
sp_before_constr_colon = add
# Add or remove space after class ':'.
sp_after_class_colon = add
# Add or remove space before class ':'.
sp_before_class_colon = add
# Add or remove space between 'operator' and operator sign.
sp_after_operator = add
# Add or remove space between the operator symbol and the open parenthesis
sp_after_operator_sym = add
sp_after_operator_sym_empty = add
# Add or remove space between '__attribute__' and '('.
sp_attribute_paren = remove
## Namespace-y stuff
# Add or remove space between a variable and '{' for a namespace.
sp_word_brace_ns = add
# Add or remove space before the '::' operator.
sp_before_dc = remove
# Add or remove space after the '::' operator.
sp_after_dc = remove
## Preprocessor statements
# Add or remove indentation of preprocessor directives inside #if blocks
# at brace level 0 (file-level).
pp_indent = add
# Whether to indent #if/#else/#endif at the brace level. If false, these are
# indented from column 1.
pp_indent_at_level = false
# Whether to indent #if/#else/#endif at the parenthesis level if the brace
# level is 0. If false, these are indented from column 1.
pp_indent_at_level0 = false
# Whether to indent '#define' at the brace level. If false, these are
# indented from column 1.
pp_define_at_level = false
# Whether to indent '#include' at the brace level.
pp_include_at_level = false
# Specifies the number of columns to indent preprocessors per level
# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies
# the number of columns to indent preprocessors per level
# at brace level > 0 (function-level).
pp_indent_count = 2
# Add or remove space after # based on pp_level of #if blocks.
pp_space = remove
# Sets the number of spaces per level added with pp_space.
pp_space_count = 0
# Add or remove space between 'defined' and '(' in '#if defined (FOO)'.
sp_defined_paren = remove
# Add or remove space between #else or #endif and a trailing comment.
sp_endif_cmt = add
# If true, a <TAB> is inserted after #define.
force_tab_after_define = false
# Force a newline in a define after the macro name for multi-line defines.
nl_multi_line_define = false # true/false
# The number of newlines before a whole-file #ifdef.
nl_before_whole_file_ifdef = 0
# The number of newlines after a whole-file #ifdef.
nl_after_whole_file_ifdef = 0
# The number of newlines before a whole-file #endif.
nl_before_whole_file_endif = 0
# The number of newlines after a whole-file #endif.
nl_after_whole_file_endif = 0
# If an #ifdef body exceeds the specified number of newlines and doesn't have
# a comment after the #endif, a comment will be added.
mod_add_long_ifdef_endif_comment = 0 # unsigned number
# If an #ifdef or #else body exceeds the specified number of newlines and
# doesn't have a comment after the #else, a comment will be added.
mod_add_long_ifdef_else_comment = 0 # unsigned number
### Newline addition/removal
## Whitespace between lines is NOT generally good.
## This is not to say it's generally bad, either, but it is generally
## less preferred. If there's some other way of visually separating
## things that should be mentally separate, then use that other way
## instead.
# Whether to collapse empty blocks between '{' and '}'
nl_collapse_empty_body = true
nl_collapse_empty_body_functions = false
# Don't split one-line braced things
nl_assign_leave_one_liners = true
nl_class_leave_one_liners = true
nl_enum_leave_one_liners = true
nl_getset_leave_one_liners = true
nl_func_leave_one_liners = true
nl_cpp_lambda_leave_one_liners = true
nl_if_leave_one_liners = true
nl_while_leave_one_liners = true
nl_do_leave_one_liners = true
nl_for_leave_one_liners = true
# Add or remove newline between '=' and '{'.
nl_assign_brace = remove
# Add or remove newline between a function call's ')' and '{', as in
# 'list_for_each(item, &list) { }'.
nl_fcall_brace = remove
# Add or remove newline between 'enum' and '{'.
nl_enum_brace = remove
# Add or remove newline between 'struct and '{'.
nl_struct_brace = remove
# Add or remove newline between 'union' and '{'.
nl_union_brace = remove
# Add or remove newline between 'if' and '{'.
nl_if_brace = remove
# Add or remove newline between '}' and 'else'.
nl_brace_else = remove
# Add or remove newline between 'else if' and '{'.
nl_elseif_brace = remove
# Add or remove newline between 'else' and '{'.
nl_else_brace = remove
# Add or remove newline between 'else' and 'if'.
nl_else_if = remove
# Add or remove newline before '{' opening brace
nl_before_opening_brace_func_class_def = remove
# Add or remove newline before 'if'/'else if' closing parenthesis.
nl_before_if_closing_paren = remove
# Add or remove newline between 'for' and '{'.
nl_for_brace = remove
# Add or remove newline between 'while' and '{'.
nl_while_brace = remove
# Add or remove newline between 'do' and '{'.
nl_do_brace = remove
# Add or remove newline between '}' and 'while' of 'do' statement.
nl_brace_while = remove
# Add or remove newline between 'switch' and '{'.
nl_switch_brace = remove
# Add a newline between ')' and '{' if the ')' is on a different line than the
# if/for/etc.
nl_multi_line_cond = false
# Add a newline after '(' if an if/for/while/switch condition spans multiple
# lines
nl_multi_line_sparen_open = remove
# Add a newline before ')' if an if/for/while/switch condition spans multiple
# lines.
nl_multi_line_sparen_close = remove
# Whether to add a newline before 'case', and a blank line before a 'case'
# statement that follows a ';' or '}'.
nl_before_case = false
# Whether to add a newline after a 'case' statement.
nl_after_case = false
# Add or remove newline between a case ':' and '{'.
# I wish this could be remove, but things like:
# "case 123: { // comment explaining 123" look too weird... :(
nl_case_colon_brace = ignore
# Add or remove newline between 'namespace' and '{'.
nl_namespace_brace = remove
# Add or remove newline between 'class' and '{'.
nl_class_brace = remove
# Add or remove newline before or after (depending on pos_class_comma,
# may not be IGNORE) each',' in the base class list.
nl_class_init_args = remove
# The position of the comma in the base class list if there is more than one
# line. Affects nl_class_init_args.
pos_class_comma = trail
# Add or remove newline between '}' and 'finally'.
nl_brace_finally = remove
# Add or remove newline between 'finally' and '{'.
nl_finally_brace = remove
# Add or remove newline between 'try' and '{'.
nl_try_brace = remove
# Add or remove newline between get/set and '{'.
nl_getset_brace = remove
# Add or remove newline before the '{' of a 'catch' statement
nl_catch_brace = remove
# Add or remove newline between '}' and 'catch'.
nl_brace_catch = remove
# Add or remove newline between '}' and ']'.
nl_brace_square = remove
# Add or remove newline between '}' and ')' in a function invocation.
nl_brace_fparen = remove
# Add or remove newline between 'synchronized' and '{'.
nl_synchronized_brace = remove
# Add or remove newline between ')' and 'throw'.
nl_before_throw = remove
# Add or remove newline between 'enum' and 'class'.
nl_enum_class = remove
# Add or remove newline between 'enum class' and the identifier.
nl_enum_class_identifier = remove
# Add or remove newline between 'enum class' type and ':'.
nl_enum_identifier_colon = remove
# Add or remove newline between 'enum class identifier :' and type.
nl_enum_colon_type = remove
# Remove newlines at the start of the file.
nl_start_of_file = remove
# Add or remove newline at the end of the file.
nl_end_of_file = force
nl_end_of_file_min = 1
# The maximum number of consecutive newlines (3 = 2 blank lines).
nl_max = 3 # unsigned number
# The maximum number of consecutive newlines in a function.
nl_max_blank_in_func = 2 # unsigned number
## Variable blocks and typedef blocks are significant enough that they
## deserve vertical whitespace
# The number of blank lines after a block of variable definitions at the top
# of a function body.
nl_func_var_def_blk = 1
# The number of newlines before a block of typedefs. If nl_after_access_spec
# is non-zero, that option takes precedence.
nl_typedef_blk_start = 1
# The number of empty newlines before a block of variable definitions
# not at the top of a function body.
nl_var_def_blk_start = 0
# The number of empty newlines after a block of variable definitions
# not at the top of a function body.
nl_var_def_blk_end = 0
# The maximum number of consecutive newlines within a block of variable
# definitions.
nl_var_def_blk_in = 2
# The number of newlines after a block of typedefs.
nl_typedef_blk_end = 2
# The maximum number of consecutive newlines within a block of typedefs.
nl_typedef_blk_in = 0
# Whether to remove blank lines after '{'.
eat_blanks_after_open_brace = true # true/false
# Whether to remove blank lines before '}'.
eat_blanks_before_close_brace = true # true/false
## Templates are behavior-modifying enough that they deserve
## vertical whitespace
# Add or remove newline after 'template<...>' of a template class.
nl_template_class = force
# Add or remove newline after 'template<...>' of a template class declaration.
nl_template_class_decl = force
# Add or remove newline after 'template<...>' of a template class definition.
nl_template_class_def = force
# Add or remove newline after 'template<>' of a specialized class declaration.
nl_template_class_decl_special = force
# Add or remove newline after 'template<>' of a specialized class definition.
nl_template_class_def_special = force
# Add or remove newline after 'template<...>' of a template function.
nl_template_func = force
# Add or remove newline after 'template<...>' of a template function declaration.
nl_template_func_decl = force
# Add or remove newline after 'template<...>' of a template function definition.
nl_template_func_def = force
# Add or remove newline after 'template<>' of a specialized function declaration.
nl_template_func_decl_special = force
# Add or remove newline after 'template<>' of a specialized function definition.
nl_template_func_def_special = force
## Labels are also significant enough....
# Whether to force a newline after a label's colon.
nl_after_label_colon = true
# The number of newlines before an access specifier label.
nl_before_access_spec = 2
# The number of newlines after an access specifier label.
nl_after_access_spec = 1
# How to indent access specifiers that are followed by a
# colon.
indent_access_spec = -2 # number
# Whether to indent the code after an access specifier by one level.
# If true, this option forces 'indent_access_spec=0'.
indent_access_spec_body = false # true/false
## Yadda, yadda, yadda...
# The number of newlines before a struct definition.
nl_before_struct = 1
# The number of newlines after '}' or ';' of a struct/enum/union definition.
nl_after_struct = 1
# The number of newlines before a class definition.
nl_before_class = 1
# The number of newlines after '}' or ';' of a class definition.
nl_after_class = 1
# The number of newlines before a namespace.
nl_before_namespace = 1
# The number of newlines after '}' of a namespace.
nl_after_namespace = 0
# The number of newlines after '{' of a namespace. This also adds newlines
# before the matching '}'.
# 0 means obey eat_blanks_after_open_brace and eat_blanks_before_close_brace
nl_inside_namespace = 0
## Comment vertical whitespace
# The minimum number of newlines before a multi-line comment.
# Doesn't apply if after a brace open or another multi-line comment.
nl_before_block_comment = 0
# The minimum number of newlines before a single-line C comment.
# Doesn't apply if after a brace open or other single-line C comments.
nl_before_c_comment = 0
# The minimum number of newlines before a CPP comment.
# Doesn't apply if after a brace open or other CPP comments.
nl_before_cpp_comment = 0
# Whether to force a newline after a multi-line comment.
nl_after_multiline_comment = false
# The number of newlines between a function definition and the function
# comment, as in '// comment\n <here> void foo() {...}'.
nl_comment_func_def = 0
## Make sure there's some visual hint that a line continues
# The position of arithmetic operators in wrapped expressions.
pos_arith = trail
# The position of assignment in wrapped expressions. Do not affect '='
# followed by '{'.
pos_assign = trail
# The position of Boolean operators in wrapped expressions.
pos_bool = trail
# The position of comparison operators in wrapped expressions.
pos_compare = trail
# The position of conditional operators, as in the '?' and ':' of
# 'expr ? stmt : stmt', in wrapped expressions.
pos_conditional = trail
# The position of the comma in wrapped expressions.
pos_comma = trail
# The position of the comma in the constructor initialization list.
pos_constr_comma = trail
# The position of trailing/leading class colon, between class and base class list.
pos_class_colon = trail
# The position of colons between constructor and member initialization.
pos_constr_colon = trail
# The position of shift operators in wrapped expressions.
pos_shift = trail
## General cleanup stuff
# Whether to remove superfluous semicolons.
mod_remove_extra_semicolon = true # true/false
# Whether to remove duplicate include.
mod_remove_duplicate_include = false
# Whether to remove a void 'return;' that appears as the last statement in a
# function.
mod_remove_empty_return = false
### Likely settings
# How aggressively to remove extra newlines not in preprocessor.
# 0: No change (default)
# 1: Remove most newlines not handled by other config
# 2: Remove all newlines and reformat completely by config
nl_remove_extra_newlines = 0
# Try to wrap comments at N columns.
cmt_width = 120 # unsigned number
# How to reflow comments.
#
# 0: No reflowing (apart from the line wrapping due to cmt_width) (default)
# 1: No touching at all
# 2: Full reflow (enable cmt_indent_multi for indent with line wrapping due to cmt_width)
cmt_reflow_mode = 0 # unsigned number
# For multi-line comments with a '*' lead, remove leading spaces if the first
# and last lines of the comment are the same length.
#
# Default: true
cmt_multi_check_last = false # true/false #### WAT
# For multi-line comments with a '*' lead, remove leading spaces if the first
# and last lines of the comment are the same length AND if the length is
# bigger as the first_len minimum.
#
# Default: 4
cmt_multi_first_len_minimum = 4 # unsigned number
# Whether to align text after 'asm volatile ()' colons.
align_asm_colon = true # true/false
# Add or remove unnecessary parenthesis on 'return' statement.
mod_paren_on_return = remove
# If a namespace body exceeds the specified number of newlines and doesn't
# have a comment after the close brace, a comment will be added.
mod_add_long_namespace_closebrace_comment = 10 # unsigned number
# If a class body exceeds the specified number of newlines and doesn't have a
# comment after the close brace, a comment will be added.
mod_add_long_class_closebrace_comment = 10 # unsigned number
## Variable block alignment
# Whether to right-align numbers.
align_number_right = true
# The span for aligning variable definitions.
align_var_def_span = 1
# The threshold for aligning variable definitions.
# Use a negative number for absolute thresholds.
align_var_def_thresh = -10
# The gap for aligning variable definitions.
align_var_def_gap = 1
# Whether to align any attribute after the variable name.
align_var_def_attribute = false # true/false
# Whether to align inline struct/enum/union variable definitions.
align_var_def_inline = true # true/false
# How to consider (or treat) the '*' in the alignment of variable definitions.
# 0: Part of the type 'void * foo;' (default)
align_var_def_star_style = 0
# How to consider (or treat) the '&' in the alignment of variable definitions.
align_var_def_amp_style = 0
## Other block alignments
# The span for aligning on '=' in assignments.
align_assign_span = 2
# The threshold for aligning on '=' in assignments.
align_assign_thresh = 8
# Whether to align on the left most assignment when multiple
# definitions are found on the same line.
align_assign_on_multi_var_defs = false # true/false
# The span for aligning on '=' in function prototype modifier.
align_assign_func_proto_span = 1
# The span for aligning on '=' in enums.
align_enum_equ_span = 1
# The threshold for aligning on '=' in enums.
align_enum_equ_thresh = 0
# The span for aligning on '{' in braced init list.
align_braced_init_list_span = 1
# The threshold for aligning on '{' in braced init list.
align_braced_init_list_thresh = 10
# The span for aligning struct/union member definitions.
align_var_struct_span = 1
# The threshold for aligning struct/union member definitions.
align_var_struct_thresh = 20
# The gap for aligning struct/union member definitions.
align_var_struct_gap = 2
# The span for aligning struct initializer values.
align_struct_init_span = 0
# The span for aligning class member definitions.
align_var_class_span = 1
# The threshold for aligning class member definitions.
align_var_class_thresh = 10
# The gap for aligning class member definitions.
align_var_class_gap = 2
# The span for aligning single-line typedefs.
align_typedef_span = 1
# The minimum space between the type and the synonym of a typedef.
align_typedef_gap = 2
# How to align typedef'd functions with other typedefs.
#
# 0: Don't mix them at all (default)
# 1: Align the open parenthesis with the types
# 2: Align the function type name with the other type names
align_typedef_func = 1 # unsigned number
# How to consider (or treat) the '*' in the alignment of typedefs.
# 0: Part of the typedef type, 'typedef int * pint;' (default)
align_typedef_star_style = 0
# How to consider (or treat) the '&' in the alignment of typedefs.
align_typedef_amp_style = 0
# The span for aligning comments that end lines.
align_right_cmt_span = 3
# Minimum number of columns between preceding text and a trailing comment in
# order for the comment to qualify for being aligned. Must be non-zero to have
# an effect.
align_right_cmt_gap = 1
# If aligning comments, whether to mix with comments after '}' and #endif with
# less than three spaces before the comment.
align_right_cmt_mix = false
# Whether to only align trailing comments that are at the same brace level.
align_right_cmt_same_level = true
# Minimum column at which to align trailing comments. Comments which are
# aligned beyond this column, but which can be aligned in a lesser column,
# may be "pulled in".
align_right_cmt_at_col = 0 # unsigned number
# Whether one-line method definitions inside a class body should be treated
# as if they were prototypes for the purposes of adding newlines.
#
# Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def
# and nl_before_func_class_def for one-liners.
nl_class_leave_one_liner_groups = true # true/false
# The number of newlines before a class constructor/destructor prototype.
nl_before_func_class_proto = 2
# The number of newlines before a class constructor/destructor definition.
nl_before_func_class_def = 2
# The number of newlines after a class constructor/destructor prototype.
nl_after_func_class_proto = 1
# The number of newlines after a class constructor/destructor prototype,
# if not followed by another constructor/destructor prototype.
nl_after_func_class_proto_group = 1
# The number of newlines after '}' of a multi-line function body in a class
# declaration. Also affects class constructors/destructors.
#
# Overrides nl_after_func_body.
nl_after_func_body_class = 2 # unsigned number
# The number of newlines inside an empty function body.
# This option overrides eat_blanks_after_open_brace and
# eat_blanks_before_close_brace, but is ignored when
# nl_collapse_empty_body_functions=true
nl_inside_empty_func = 1 # unsigned number