aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2026-01-31 04:14:07 +0000
committerEnji Cooper <ngie@FreeBSD.org>2026-01-31 04:14:10 +0000
commitab9b04736945537743eb0624ead7a4fa4b960783 (patch)
tree603bf6fcccc9d16c5b6bab51f51f47c0931a2885
parent9df110b11f2dc8802fe6418b96e417f93ba6a753 (diff)
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
-rw-r--r--.clang-format4
1 files changed, 2 insertions, 2 deletions
diff --git a/.clang-format b/.clang-format
index 3d436fa0b35d..efe9f1202bde 100644
--- a/.clang-format
+++ b/.clang-format
@@ -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.