MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: klimek, mitchell-stellar, owenpan.
MyDeveloperDay added projects: clang-format, clang.

Running dump_format_style.py on the tip of the trunk causes 
ClangFormatStyleOptions.rst to have changes, which I think ideally it shouldn't.

Some recent commits have meant Format.h and ClangFormatStyleOptions.rst have 
become out of sync such that dump_format_style.py either couldn't be run or 
generated incorrect .rst files.

It's also important to remember to edit the IncludeStyles from Tooling.

Make a couple of changes which came from recent clang-format commits that 
missed this step. There are still a couple of other changes which also need to 
be made, but I'd like to park these changes first.


Repository:
  rC Clang

https://reviews.llvm.org/D69404

Files:
  clang/include/clang/Format/Format.h
  clang/include/clang/Tooling/Inclusions/IncludeStyle.h

Index: clang/include/clang/Tooling/Inclusions/IncludeStyle.h
===================================================================
--- clang/include/clang/Tooling/Inclusions/IncludeStyle.h
+++ clang/include/clang/Tooling/Inclusions/IncludeStyle.h
@@ -84,18 +84,27 @@
   /// (https://llvm.org/docs/CodingStandards.html#include-style). However, you
   /// can also assign negative priorities if you have certain headers that
   /// always need to be first.
+  /// 
+  /// There is a third and optional field ``SortPriority`` which can used while
+  /// ``IncludeBloks = IBS_Regroup`` to define the priority in which ``#includes``
+  /// should be ordered, and value of ``Priority`` defines the order of
+  /// ``#include blocks`` and also enables to group ``#includes`` of different
+  /// priority for order.``SortPriority`` is set to the value of ``Priority``
+  /// as default if it is not assigned.
   ///
   /// To configure this in the .clang-format file, use:
   /// \code{.yaml}
   ///   IncludeCategories:
   ///     - Regex:           '^"(llvm|llvm-c|clang|clang-c)/'
   ///       Priority:        2
+  ///       SortPriority:    2
   ///     - Regex:           '^(<|"(gtest|gmock|isl|json)/)'
   ///       Priority:        3
   ///     - Regex:           '<[[:alnum:].]+>'
   ///       Priority:        4
   ///     - Regex:           '.*'
   ///       Priority:        1
+  ///       SortPriority:    0
   /// \endcode
   std::vector<IncludeCategory> IncludeCategories;
 
Index: clang/include/clang/Format/Format.h
===================================================================
--- clang/include/clang/Format/Format.h
+++ clang/include/clang/Format/Format.h
@@ -706,21 +706,19 @@
     ///   };
     /// \endcode
     BS_Allman,
-    /// Always break before braces and add an extra level of indentation to
-    /// braces of control statements, not to those of class, function
-    /// or other definitions.
+    /// Like ``Allman`` but always indent braces and line up code with braces.
     /// \code
-    ///   try
+    ///    try
     ///     {
-    ///       foo();
+    ///     foo();
     ///     }
     ///   catch ()
     ///     {
     ///     }
     ///   void foo() { bar(); }
     ///   class foo
-    ///   {
-    ///   };
+    ///     {
+    ///     };
     ///   if (foo())
     ///     {
     ///     }
@@ -728,25 +726,27 @@
     ///     {
     ///     }
     ///   enum X : int
-    ///   {
+    ///     {
     ///     A,
     ///     B
-    ///   };
+    ///     };
     /// \endcode
     BS_Whitesmiths,
-    /// Like ``Allman`` but always indent braces and line up code with braces.
+    /// Always break before braces and add an extra level of indentation to
+    /// braces of control statements, not to those of class, function
+    /// or other definitions.
     /// \code
-    ///    try
+    ///   try
     ///     {
-    ///     foo();
+    ///       foo();
     ///     }
     ///   catch ()
     ///     {
     ///     }
     ///   void foo() { bar(); }
     ///   class foo
-    ///     {
-    ///     };
+    ///   {
+    ///   };
     ///   if (foo())
     ///     {
     ///     }
@@ -754,10 +754,10 @@
     ///     {
     ///     }
     ///   enum X : int
-    ///     {
+    ///   {
     ///     A,
     ///     B
-    ///     };
+    ///   };
     /// \endcode
     BS_GNU,
     /// Like ``Attach``, but break before functions.
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to