]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - .clang-format
OpenZFS: MFV 2.0-rc3-gfc5966
[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.*/'
106     Priority: 2
107     SortPriority: 23
108   - Regex: '^<vm/vm\.h>'
109     Priority: 3
110     SortPriority: 30
111   - Regex: '^<vm/'
112     Priority: 3
113     SortPriority: 31
114   - Regex: '^<machine/'
115     Priority: 4
116     SortPriority: 40
117   - Regex: '^<(x86|amd64|i386|xen)/'
118     Priority: 5
119     SortPriority: 50
120   - Regex: '^<dev/'
121     Priority: 6
122     SortPriority: 60
123   - Regex: '^<net.*/'
124     Priority: 7
125     SortPriority: 70
126   - Regex: '^<protocols/'
127     Priority: 7
128     SortPriority: 71
129   - Regex: '^<(fs|nfs(|client|server)|ufs)/'
130     Priority: 8
131     SortPriority: 80
132   - Regex: '^<[^/].*\.h'
133     Priority: 9
134     SortPriority: 90
135   - Regex: '^\".*\.h\"'
136     Priority: 10
137     SortPriority: 100
138 # LLVM's header include ordering style is almost the exact opposite of ours.
139 # Unfortunately, they have hard-coded their preferences into clang-format.
140 # Clobbering this regular expression to avoid matching prevents non-system
141 # headers from being forcibly moved to the top of the include list.
142 # http://llvm.org/docs/CodingStandards.html#include-style
143 IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING'
144 SortIncludes: true
145 KeepEmptyLinesAtTheStartOfBlocks: true
146 TypenameMacros:
147   - ARB_ELMTYPE
148   - ARB_HEAD
149   - ARB8_HEAD
150   - ARB16_HEAD
151   - ARB32_HEAD
152   - ARB_ENTRY
153   - ARB8_ENTRY
154   - ARB16_ENTRY
155   - ARB32_ENTRY
156   - LIST_CLASS_ENTRY
157   - LIST_CLASS_HEAD
158   - LIST_ENTRY
159   - LIST_HEAD
160   - QUEUE_TYPEOF
161   - RB_ENTRY
162   - RB_HEAD
163   - SLIST_CLASS_HEAD
164   - SLIST_CLASS_ENTRY
165   - SLIST_HEAD
166   - SLIST_ENTRY
167   - SMR_POINTER
168   - SPLAY_ENTRY
169   - SPLAY_HEAD
170   - STAILQ_CLASS_ENTRY
171   - STAILQ_CLASS_HEAD
172   - STAILQ_ENTRY
173   - STAILQ_HEAD
174   - TAILQ_CLASS_ENTRY
175   - TAILQ_CLASS_HEAD
176   - TAILQ_ENTRY
177   - TAILQ_HEAD