clang-format allows the reordering and regrouping of includes, but does not touch the distinction between #include ""
and #include <>
, even though some projects may also want to uniformize this. While GCC and clang have the distinct flags -isystem
, -iquote
and -I
, CMake only supports -isystem
and -I
, and I don’t expect this to change in the near future, so I would suggest for the ambiguous -I
paths to add another configuration option IncludeStyle: quotes|brackets
to automatically fix these issues. Since this might theoretically break code during formatting, I wanted to discuss it here first.
The context where this came up was with clangd’s include fixup, which always uses double quotes for includes unless they are found in -isystem
paths. While this is usually the case for libraries that are installed system-wide, it is not true for library development and similar cases. I don’t think clangd is necessary the right place to tackle this.