Skip to content

Commit e895442

Browse files
committed
Add header groups to clang-format
1 parent 2f372af commit e895442

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.clang-format

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,24 @@ AlignAfterOpenBracket: Align
44
AlignConsecutiveDeclarations: 'false'
55
BreakBeforeBraces: Allman
66
NamespaceIndentation: All
7+
IncludeBlocks: Regroup
8+
# First regex to match classifies the header into a group.
9+
# Group are ordered in the source code by increasing priority.
10+
IncludeCategories:
11+
# Standard headers
12+
- Regex: <[^\.]+>
13+
Priority: 4
14+
# Third party dependencies (prefer angle bracket over quotes)
15+
- Regex: <.+\..+>
16+
Priority: 3
17+
# xsimd absolute headers (e.g. in tests)
18+
- Regex: '["<]xsimd/.+[">]'
19+
Priority: 2
20+
# Relative header from project
21+
- Regex: '"\.+.*"'
22+
Priority: 1
23+
# Not quoted header (anything else, avoid)
24+
- Regex: '".*"'
25+
Priority: 0
726

827
...

0 commit comments

Comments
 (0)