Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Jun 2020 18:40:43 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r362590 - head
Message-ID:  <202006241840.05OIehlS052414@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Wed Jun 24 18:40:43 2020
New Revision: 362590
URL: https://svnweb.freebsd.org/changeset/base/362590

Log:
  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

Modified:
  head/.clang-format

Modified: head/.clang-format
==============================================================================
--- head/.clang-format	Wed Jun 24 17:54:24 2020	(r362589)
+++ head/.clang-format	Wed Jun 24 18:40:43 2020	(r362590)
@@ -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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006241840.05OIehlS052414>