]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - .clang-format
clang-format: place sys/systm.h immediately after sys/param.h
[FreeBSD/FreeBSD.git] / .clang-format
1 # $FreeBSD$
2 # Basic .clang-format
3 ---
4 BasedOnStyle: WebKit
5 AlignAfterOpenBracket: DontAlign
6 AlignConsecutiveAssignments: false
7 AlignConsecutiveDeclarations: false
8 AlignEscapedNewlines: Left
9 AlignOperands: false
10 AlignTrailingComments: true
11 AllowAllParametersOfDeclarationOnNextLine: false
12 AllowShortBlocksOnASingleLine: Never
13 AllowShortCaseLabelsOnASingleLine: false
14 AllowShortFunctionsOnASingleLine: InlineOnly
15 AllowShortIfStatementsOnASingleLine: Never
16 AllowShortLoopsOnASingleLine: false
17 AlwaysBreakAfterReturnType: TopLevelDefinitions
18 AlwaysBreakBeforeMultilineStrings: false
19 AlwaysBreakTemplateDeclarations: MultiLine
20 BinPackArguments: true
21 BinPackParameters: true
22 BreakBeforeBinaryOperators: None
23 BreakBeforeBraces: WebKit
24 BreakBeforeTernaryOperators: false
25 # TODO: BreakStringLiterals can cause very strange formatting so turn it off?
26 BreakStringLiterals: false
27 PenaltyBreakBeforeFirstCallParameter: 1000
28 CompactNamespaces: true
29 DerivePointerAlignment: false
30 DisableFormat: false
31 ForEachMacros:
32   - ARB_ARRFOREACH
33   - ARB_ARRFOREACH_REVWCOND
34   - ARB_ARRFOREACH_REVERSE
35   - ARB_FOREACH
36   - ARB_FOREACH_FROM
37   - ARB_FOREACH_SAFE
38   - ARB_FOREACH_REVERSE
39   - ARB_FOREACH_REVERSE_FROM
40   - ARB_FOREACH_REVERSE_SAFE
41   - CPU_FOREACH
42   - FOREACH_THREAD_IN_PROC
43   - FOREACH_PROC_IN_SYSTEM
44   - FOREACH_PRISON_CHILD
45   - FOREACH_PRISON_DESCENDANT
46   - FOREACH_PRISON_DESCENDANT_LOCKED
47   - FOREACH_PRISON_DESCENDANT_LOCKED_LEVEL
48   - MNT_VNODE_FOREACH_ALL
49   - MNT_VNODE_FOREACH_ACTIVE
50   - RB_FOREACH
51   - RB_FOREACH_FROM
52   - RB_FOREACH_SAFE
53   - RB_FOREACH_REVERSE
54   - RB_FOREACH_REVERSE_FROM
55   - RB_FOREACH_REVERSE_SAFE
56   - SLIST_FOREACH
57   - SLIST_FOREACH_FROM
58   - SLIST_FOREACH_FROM_SAFE
59   - SLIST_FOREACH_SAFE
60   - SLIST_FOREACH_PREVPTR
61   - SPLAY_FOREACH
62   - LIST_FOREACH
63   - LIST_FOREACH_FROM
64   - LIST_FOREACH_FROM_SAFE
65   - LIST_FOREACH_SAFE
66   - STAILQ_FOREACH
67   - STAILQ_FOREACH_FROM
68   - STAILQ_FOREACH_FROM_SAFE
69   - STAILQ_FOREACH_SAFE
70   - TAILQ_FOREACH
71   - TAILQ_FOREACH_FROM
72   - TAILQ_FOREACH_FROM_SAFE
73   - TAILQ_FOREACH_REVERSE
74   - TAILQ_FOREACH_REVERSE_FROM
75   - TAILQ_FOREACH_REVERSE_FROM_SAFE
76   - TAILQ_FOREACH_REVERSE_SAFE
77   - TAILQ_FOREACH_SAFE
78   - VM_MAP_ENTRY_FOREACH
79   - VM_PAGE_DUMP_FOREACH
80 IndentCaseLabels: false
81 IndentPPDirectives: None
82 Language: Cpp
83 NamespaceIndentation: None
84 PointerAlignment: Right
85 ContinuationIndentWidth: 4
86 IndentWidth: 8
87 TabWidth: 8
88 ColumnLimit: 80
89 UseTab: Always
90 SpaceAfterCStyleCast: false
91 IncludeBlocks: Regroup
92 IncludeCategories:
93   - Regex: '^\"opt_.*\.h\"'
94     Priority: 1
95     SortPriority: 10
96   - Regex: '^<sys/cdefs\.h>'
97     Priority: 2
98     SortPriority: 20
99   - Regex: '^<sys/types\.h>'
100     Priority: 2
101     SortPriority: 21
102   - Regex: '^<sys/param\.h>'
103     Priority: 2
104     SortPriority: 22
105   - Regex: '^<sys/systm\.h>'
106     Priority: 2
107     SortPriority: 23
108   - Regex: '^<sys.*/'
109     Priority: 2
110     SortPriority: 24
111   - Regex: '^<vm/vm\.h>'
112     Priority: 3
113     SortPriority: 30
114   - Regex: '^<vm/'
115     Priority: 3
116     SortPriority: 31
117   - Regex: '^<machine/'
118     Priority: 4
119     SortPriority: 40
120   - Regex: '^<(x86|amd64|i386|xen)/'
121     Priority: 5
122     SortPriority: 50
123   - Regex: '^<dev/'
124     Priority: 6
125     SortPriority: 60
126   - Regex: '^<net.*/'
127     Priority: 7
128     SortPriority: 70
129   - Regex: '^<protocols/'
130     Priority: 7
131     SortPriority: 71
132   - Regex: '^<(fs|nfs(|client|server)|ufs)/'
133     Priority: 8
134     SortPriority: 80
135   - Regex: '^<[^/].*\.h'
136     Priority: 9
137     SortPriority: 90
138   - Regex: '^\".*\.h\"'
139     Priority: 10
140     SortPriority: 100
141 # LLVM's header include ordering style is almost the exact opposite of ours.
142 # Unfortunately, they have hard-coded their preferences into clang-format.
143 # Clobbering this regular expression to avoid matching prevents non-system
144 # headers from being forcibly moved to the top of the include list.
145 # http://llvm.org/docs/CodingStandards.html#include-style
146 IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING'
147 SortIncludes: true
148 KeepEmptyLinesAtTheStartOfBlocks: true
149 TypenameMacros:
150   - ARB_ELMTYPE
151   - ARB_HEAD
152   - ARB8_HEAD
153   - ARB16_HEAD
154   - ARB32_HEAD
155   - ARB_ENTRY
156   - ARB8_ENTRY
157   - ARB16_ENTRY
158   - ARB32_ENTRY
159   - LIST_CLASS_ENTRY
160   - LIST_CLASS_HEAD
161   - LIST_ENTRY
162   - LIST_HEAD
163   - QUEUE_TYPEOF
164   - RB_ENTRY
165   - RB_HEAD
166   - SLIST_CLASS_HEAD
167   - SLIST_CLASS_ENTRY
168   - SLIST_HEAD
169   - SLIST_ENTRY
170   - SMR_POINTER
171   - SPLAY_ENTRY
172   - SPLAY_HEAD
173   - STAILQ_CLASS_ENTRY
174   - STAILQ_CLASS_HEAD
175   - STAILQ_ENTRY
176   - STAILQ_HEAD
177   - TAILQ_CLASS_ENTRY
178   - TAILQ_CLASS_HEAD
179   - TAILQ_ENTRY
180   - TAILQ_HEAD