1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

clang-format: adjust to sort C++ headers per style(9)

Many standard C++ headers do not have the .h file extension: some, such as
`iostream`, lack it; others have a .hpp file extension. Moreover, some
projects (like ATF/Kyua) also contain .ipp files, which are C++ "interface"
files.

Relax the regular expression to ensure that non-traditional C "system"
headers, C++ headers, etc, with angle brackets are sorted before
"local" headers.

MFC after:	1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D54401
This commit is contained in:
Enji Cooper
2026-01-30 20:14:07 -08:00
parent 9df110b11f
commit ab9b047369
+2 -2
View File
@@ -151,10 +151,10 @@ IncludeCategories:
- Regex: '^<(fs|nfs(|client|server)|ufs)/'
Priority: 8
SortPriority: 80
- Regex: '^<[^/].*\.h'
- Regex: '^<[^/].*'
Priority: 9
SortPriority: 90
- Regex: '^\".*\.h\"'
- Regex: '^\".*\"'
Priority: 10
SortPriority: 100
# LLVM's header include ordering style is almost the exact opposite of ours.