[llvm-bugs] [Bug 46328] New: Using SortPriority split include groups (= includes with the same Priority field)

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jun 15 07:55:42 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46328

            Bug ID: 46328
           Summary: Using SortPriority split include groups (= includes
                    with the same Priority field)
           Product: clang
           Version: 10.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: laefy22 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

When using IncludeBlocks: Regroup, it seems SortPriority takes precedence over
Priority, which is counter intuitive: I wouldn't expect blocks to be split when
the includes have the same priority.

Exemple:

---------------------------
IncludeBlocks: Regroup
IncludeCategories:
  # G1
    - Regex:           'G1_1'
      Priority:        0
      SortPriority:    0

    - Regex:           'G1_2'
      Priority:        0
      SortPriority:    1

    - Regex:           'G1_3'
      Priority:        0
      SortPriority:    2

  # G2
    - Regex:           'G2'
      Priority:        1
---------------------------

gives the following output:
---------------------------
#include <G1_1.h>
#include <G1_2.h>

#include <G2.h>

#include <G1_3.h>
---------------------------

instead of:
---------------------------
#include <G1_1.h>
#include <G1_2.h>
#include <G1_3.h>

#include <G2.h>
---------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200615/3ca167f3/attachment.html>


More information about the llvm-bugs mailing list