diff --git a/clang/include/clang/Format/Format.h b/clang/include/clang/Format/Format.h --- a/clang/include/clang/Format/Format.h +++ b/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. diff --git a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h b/clang/include/clang/Tooling/Inclusions/IncludeStyle.h --- a/clang/include/clang/Tooling/Inclusions/IncludeStyle.h +++ b/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 IncludeCategories;