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: unassignedclangb...@nondot.org
          Reporter: vladi...@pobox.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to