@@ -309,12 +309,28 @@ the configuration (without a prefix: ``Auto``).
309
309
* ``SFS_None `` (in configuration: ``None ``)
310
310
Never merge functions into a single line.
311
311
312
+ * ``SFS_InlineOnly `` (in configuration: ``InlineOnly ``)
313
+ Only merge functions defined inside a class. Same as "inline",
314
+ except it does not implies "empty": i.e. top level empty functions
315
+ are not merged either.
316
+
317
+ .. code-block :: c++
318
+
319
+ class Foo {
320
+ void f() { foo(); }
321
+ };
322
+ void f() {
323
+ foo();
324
+ }
325
+ void f() {
326
+ }
327
+
312
328
* ``SFS_Empty `` (in configuration: ``Empty ``)
313
329
Only merge empty functions.
314
330
315
331
.. code-block :: c++
316
332
317
- void f() { bar(); }
333
+ void f() {}
318
334
void f2() {
319
335
bar2();
320
336
}
@@ -327,6 +343,10 @@ the configuration (without a prefix: ``Auto``).
327
343
class Foo {
328
344
void f() { foo(); }
329
345
};
346
+ void f() {
347
+ foo();
348
+ }
349
+ void f() {}
330
350
331
351
* ``SFS_All `` (in configuration: ``All ``)
332
352
Merge all functions fitting on a single line.
@@ -521,11 +541,11 @@ the configuration (without a prefix: ``Auto``).
521
541
.. code-block :: c++
522
542
523
543
true:
524
- class foo
525
- {};
544
+ class foo {};
526
545
527
546
false:
528
- class foo {};
547
+ class foo
548
+ {};
529
549
530
550
* ``bool AfterControlStatement `` Wrap control statements (``if ``/``for ``/``while ``/``switch ``/..).
531
551
@@ -659,6 +679,18 @@ the configuration (without a prefix: ``Auto``).
659
679
660
680
* ``bool IndentBraces `` Indent the wrapped braces themselves.
661
681
682
+ * ``bool SplitEmptyFunctionBody `` If ``false ``, empty function body can be put on a single line.
683
+ This option is used only if the opening brace of the function has
684
+ already been wrapped, i.e. the `AfterFunction ` brace wrapping mode is
685
+ set, and the function could/should not be put on a single line (as per
686
+ `AllowShortFunctionsOnASingleLine ` and constructor formatting options).
687
+
688
+ .. code-block :: c++
689
+
690
+ int f() vs. inf f()
691
+ {} {
692
+ }
693
+
662
694
663
695
**BreakAfterJavaFieldAnnotations ** (``bool ``)
664
696
Break after each annotation on a field in Java files.
@@ -899,17 +931,40 @@ the configuration (without a prefix: ``Auto``).
899
931
firstValue :
900
932
SecondValueVeryVeryVeryVeryLong;
901
933
902
- **BreakConstructorInitializersBeforeComma ** (``bool ``)
903
- Always break constructor initializers before commas and align
904
- the commas with the colon.
934
+ **BreakConstructorInitializers ** (``BreakConstructorInitializersStyle ``)
935
+ The constructor initializers style to use.
936
+
937
+ Possible values:
938
+
939
+ * ``BCIS_BeforeColon `` (in configuration: ``BeforeColon ``)
940
+ Break constructor initializers before the colon and after the commas.
941
+
942
+ .. code-block :: c++
943
+
944
+ Constructor()
945
+ : initializer1(),
946
+ initializer2()
947
+
948
+ * ``BCIS_BeforeComma `` (in configuration: ``BeforeComma ``)
949
+ Break constructor initializers before the colon and commas, and align
950
+ the commas with the colon.
951
+
952
+ .. code-block :: c++
953
+
954
+ Constructor()
955
+ : initializer1()
956
+ , initializer2()
957
+
958
+ * ``BCIS_AfterColon `` (in configuration: ``AfterColon ``)
959
+ Break constructor initializers after the colon and commas.
960
+
961
+ .. code-block :: c++
962
+
963
+ Constructor() :
964
+ initializer1(),
965
+ initializer2()
905
966
906
- .. code-block :: c++
907
967
908
- true: false:
909
- SomeClass::Constructor() vs. SomeClass::Constructor() : a(a),
910
- : a(a) b(b),
911
- , b(b) c(c) {}
912
- , c(c) {}
913
968
914
969
**BreakStringLiterals ** (``bool ``)
915
970
Allow breaking string literals when formatting.
@@ -931,6 +986,31 @@ the configuration (without a prefix: ``Auto``).
931
986
// Will leave the following line unaffected
932
987
#include <vector> // FOOBAR pragma: keep
933
988
989
+ **CompactNamespaces ** (``bool ``)
990
+ If ``true ``, consecutive namespace declarations will be on the same
991
+ line. If ``false ``, each namespace is declared on a new line.
992
+
993
+ .. code-block :: c++
994
+
995
+ true:
996
+ namespace Foo { namespace Bar {
997
+ }}
998
+
999
+ false:
1000
+ namespace Foo {
1001
+ namespace Bar {
1002
+ }
1003
+ }
1004
+
1005
+ If it does not fit on a single line, the overflowing namespaces get
1006
+ wrapped:
1007
+
1008
+ .. code-block :: c++
1009
+
1010
+ namespace Foo { namespace Bar {
1011
+ namespace Extra {
1012
+ }}}
1013
+
934
1014
**ConstructorInitializerAllOnOneLineOrOnePerLine ** (``bool ``)
935
1015
If the constructor initializers don't fit on a line, put each
936
1016
initializer on its own line.
@@ -1321,6 +1401,9 @@ the configuration (without a prefix: ``Auto``).
1321
1401
Add a space in front of an Objective-C protocol list, i.e. use
1322
1402
``Foo <Protocol> `` instead of ``Foo<Protocol> ``.
1323
1403
1404
+ **PenaltyBreakAssignment ** (``unsigned ``)
1405
+ The penalty for breaking around an assignment operator.
1406
+
1324
1407
**PenaltyBreakBeforeFirstCallParameter ** (``unsigned ``)
1325
1408
The penalty for breaking a function call after ``call( ``.
1326
1409
0 commit comments