Add include categories to .clang-format

This adds 3 rules that clang-format uses when ordering include files:
 - common.h is assigned priority -1
 - Incudes using <> is given priority 1
 - Includes using "" is given priority 2

It also disables putting the "main" file first (the .h/.hpp with the
same name as the .c/.cpp"

#5074
[ci skip]
This commit is contained in:
Hielke Morsink 2017-01-14 19:30:48 +01:00 committed by Ted John
parent c418836a87
commit a36b200dda
1 changed files with 8 additions and 0 deletions

View File

@ -7,6 +7,14 @@ AllowShortFunctionsOnASingleLine: Empty
BreakBeforeBraces: Allman
ColumnLimit: '128'
Cpp11BracedListStyle: 'false'
IncludeCategories:
- Regex: '^"(\./)*common\.h"$'
Priority: -1
- Regex: '^<.*>$'
Priority: 1
- Regex: '^".*"$'
Priority: 2
IncludeIsMainRegex: 'false'
IndentWidth: '4'
PointerAlignment: Middle
SortIncludes: 'true'