[clang-format] Extract doc for entire configuration structs
authorsstwcw <f0gukp2nk@protonmail.com>
Mon, 14 Mar 2022 01:24:31 +0000 (01:24 +0000)
committersstwcw <f0gukp2nk@protonmail.com>
Mon, 14 Mar 2022 04:41:40 +0000 (04:41 +0000)
Previously the comments for configuration structs as a whole like
`BraceWrappingFlags` did not go into the doc.

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D120361

clang/docs/ClangFormatStyleOptions.rst
clang/docs/tools/dump_format_style.py

index 9b5d9ee..c1af144 100644 (file)
@@ -1212,6 +1212,14 @@ the configuration (without a prefix: ``Auto``).
 
   Nested configuration flags:
 
+  Precise control over the wrapping of braces.
+
+  .. code-block:: c++
+
+    # Should be declared this way:
+    BreakBeforeBraces: Custom
+    BraceWrapping:
+        AfterClass: true
 
   * ``bool AfterCaseLabel`` Wrap case labels.
 
@@ -3992,6 +4000,15 @@ the configuration (without a prefix: ``Auto``).
 
   Nested configuration flags:
 
+  Precise control over the spacing before parentheses.
+
+  .. code-block:: c++
+
+    # Should be declared this way:
+    SpaceBeforeParens: Custom
+    SpaceBeforeParensOptions:
+      AfterControlStatements: true
+      AfterFunctionDefinitionName: true
 
   * ``bool AfterControlStatements`` If ``true``, put space betwee control statement keywords
     (for/if/while...) and opening parentheses.
@@ -4221,6 +4238,7 @@ the configuration (without a prefix: ``Auto``).
 
   Nested configuration flags:
 
+  Control of spaces within a single line comment
 
   * ``unsigned Minimum`` The minimum number of spaces at the start of the comment.
 
index d049209..fb07443 100755 (executable)
@@ -118,7 +118,7 @@ class NestedStruct(object):
     self.values = []
 
   def __str__(self):
-    return '\n'.join(map(str, self.values))
+    return self.comment + '\n' + '\n'.join(map(str, self.values))
 
 class NestedField(object):
   def __init__(self, name, comment):