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.
Issue persist clang-format 11.0.
Seems confusing to me as well, put in a quick hotfix https://reviews.llvm.org/D101628
Fixed in https://github.com/llvm/llvm-project/commit/61dc0f2b593da149a4c0cea67819cd7bdbdd50b8