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