summaryrefslogtreecommitdiff
path: root/.clang-format
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-06-24 18:40:43 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-06-24 18:40:43 +0000
commite59d5d14d7e3554b45432c29a8f73df447997770 (patch)
tree5df10233ee47aaee4973c982e0f5401222b2bf62 /.clang-format
parent99db5849f7506e765c43f4e69a7105cc888e8d5e (diff)
downloadsrc-test-e59d5d14d7e3554b45432c29a8f73df447997770.tar.gz
src-test-e59d5d14d7e3554b45432c29a8f73df447997770.zip
Update .clang-format with style(9) header-sorting
Thanks to work done in the NetBSD clang-format project. No functional change. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D25428
Notes
Notes: svn path=/head/; revision=362590
Diffstat (limited to '.clang-format')
-rw-r--r--.clang-format49
1 files changed, 48 insertions, 1 deletions
diff --git a/.clang-format b/.clang-format
index facbea5f3156a..1c6253ddaacee 100644
--- a/.clang-format
+++ b/.clang-format
@@ -64,7 +64,54 @@ TabWidth: 8
ColumnLimit: 80
UseTab: Always
SpaceAfterCStyleCast: false
-SortIncludes: false
+IncludeBlocks: Regroup
+IncludeCategories:
+ - Regex: '^\"opt_.*\.h\"'
+ Priority: 1
+ SortPriority: 10
+ - Regex: '^<sys/cdefs\.h>'
+ Priority: 2
+ SortPriority: 20
+ - Regex: '^<sys/types\.h>'
+ Priority: 2
+ SortPriority: 21
+ - Regex: '^<sys/param\.h>'
+ Priority: 2
+ SortPriority: 22
+ - Regex: '^<sys.*/'
+ Priority: 2
+ SortPriority: 23
+ - Regex: '^<vm/vm\.h>'
+ Priority: 3
+ SortPriority: 30
+ - Regex: '^<vm/'
+ Priority: 3
+ SortPriority: 31
+ - Regex: '^<machine/'
+ Priority: 4
+ SortPriority: 40
+ - Regex: '^<(x86|amd64|i386|xen)/'
+ Priority: 5
+ SortPriority: 50
+ - Regex: '^<dev/'
+ Priority: 6
+ SortPriority: 60
+ - Regex: '^<net.*/'
+ Priority: 7
+ SortPriority: 70
+ - Regex: '^<protocols/'
+ Priority: 7
+ SortPriority: 71
+ - Regex: '^<(fs|nfs(|client|server)|ufs)/'
+ Priority: 8
+ SortPriority: 80
+ - Regex: '^<[^/].*\.h'
+ Priority: 9
+ SortPriority: 90
+ - Regex: '^\".*\.h\"'
+ Priority: 10
+ SortPriority: 100
+SortIncludes: true
KeepEmptyLinesAtTheStartOfBlocks: true
# The options below will only be supported starting with clang 9.0:
# TODO-CLANG-9: TypenameMacros: