[llvm-bugs] [Bug 35099] New: clang-format performs SortIncludes even if DisableFormat: true

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Oct 26 09:00:39 PDT 2017


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

            Bug ID: 35099
           Summary: clang-format performs SortIncludes even if
                    DisableFormat: true
           Product: clang
           Version: 5.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: vladimir at pobox.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org

DisableFormat: true doesn't turn off SortIncludes (clang-format 5.0):

$ printf '#include <B>\n#include <A>\n' | clang-format
-assume-filename=test.cpp -style='{DisableFormat: true}'
#include <A>
#include <B>

It needs to be explicitly specified as false to turn it off:

$ printf '#include <B>\n#include <A>\n' | clang-format
-assume-filename=test.cpp -style='{DisableFormat: true, SortIncludes: false}'
#include <B>
#include <A>

Not sure if it is intentional or not -- was surprising at the very least.

-- 
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/20171026/a5ab622e/attachment-0001.html>


More information about the llvm-bugs mailing list