[PATCH] D37531: Add an usage example of BreakBeforeBraces

Sylvestre Ledru via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 7 03:07:11 PDT 2017


sylvestre.ledru updated this revision to Diff 114136.
sylvestre.ledru added a comment.
Herald added a subscriber: klimek.

Thanks. I need more coffee.


https://reviews.llvm.org/D37531

Files:
  docs/ClangFormatStyleOptions.rst
  include/clang/Format/Format.h


Index: include/clang/Format/Format.h
===================================================================
--- include/clang/Format/Format.h
+++ include/clang/Format/Format.h
@@ -746,6 +746,14 @@
   ///
   /// If ``BreakBeforeBraces`` is set to ``BS_Custom``, use this to specify how
   /// each individual brace case should be handled. Otherwise, this is ignored.
+  /// \code{.yaml}
+  ///   # Example of usage:
+  ///   BreakBeforeBraces: Custom
+  ///   BraceWrapping:
+  ///     AfterEnum: true
+  ///     AfterStruct: false
+  ///     SplitEmptyFunction: false
+  /// \endcode
   BraceWrappingFlags BraceWrapping;
 
   /// \brief If ``true``, ternary operators will be placed after line breaks.
Index: docs/ClangFormatStyleOptions.rst
===================================================================
--- docs/ClangFormatStyleOptions.rst
+++ docs/ClangFormatStyleOptions.rst
@@ -533,6 +533,15 @@
   If ``BreakBeforeBraces`` is set to ``BS_Custom``, use this to specify how
   each individual brace case should be handled. Otherwise, this is ignored.
 
+  .. code-block:: yaml
+
+    # Example of usage:
+    BreakBeforeBraces: Custom
+    BraceWrapping:
+      AfterEnum: true
+      AfterStruct: false
+      SplitEmptyFunction: false
+
   Nested configuration flags:
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37531.114136.patch
Type: text/x-patch
Size: 1279 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170907/c85e5360/attachment.bin>


More information about the cfe-commits mailing list