In our C++ project, the order of our includes is regularly changed. This is a problem since we are using some third-party libraries which require a specific include order to avoid problems.
I know, this is bad but we have to deal with it.
Unfortunately, the order of our includes is regularly changed and I suppose that this is due to clang-format
. I found a page where you can specify a variable includeCategories
.
However, I do not fully understand how it works.
I simply want to completely disable the ordering of includes.
How can I do this?
Have you tried: SortIncludes: false
?
You can generate a .clang-format
with preview here: https://zed0.co.uk/clang-format-configurator/
To disable sorting for the whole project use SortIncludes:false
in .clang-format
.
To disable clang-format only for a specific file region, use // clang-format off/on
comments.
// clang-format off
#include <b.h>
#include <a.h>
#include <c.h>
// clang-format on
#include <d.h>
#include <e.h>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With