Some compilers require the pre-compiled-header to be included first. Clang-format can sort the headers (which is good). I want to make sure that pch will always be first.
How can I do this?
(My work around is to use IncludeBlocksStyle: Preserve
and seperate #include "pch.h"
from the rest.)
You can use negative priorities in IncludeCategories
, so you can do something like this:
IncludeBlocksStyle: Regroup
IncludeCategories:
- Regex: '"pch.h"'
Priority: -1000
# Other groups definitions here