]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - .clang-format
Upgrade to version 3.1.4
[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: false
11 AllowAllParametersOfDeclarationOnNextLine: false
12 AllowShortBlocksOnASingleLine: false
13 AllowShortCaseLabelsOnASingleLine: false
14 AllowShortFunctionsOnASingleLine: InlineOnly
15 AllowShortIfStatementsOnASingleLine: false
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 IndentCaseLabels: false
80 IndentPPDirectives: None
81 Language: Cpp
82 NamespaceIndentation: None
83 PointerAlignment: Right
84 ContinuationIndentWidth: 4
85 IndentWidth: 8
86 TabWidth: 8
87 ColumnLimit: 80
88 UseTab: Always
89 SpaceAfterCStyleCast: false
90 IncludeBlocks: Regroup
91 IncludeCategories:
92   - Regex: '^\"opt_.*\.h\"'
93     Priority: 1
94     SortPriority: 10
95   - Regex: '^<sys/cdefs\.h>'
96     Priority: 2
97     SortPriority: 20
98   - Regex: '^<sys/types\.h>'
99     Priority: 2
100     SortPriority: 21
101   - Regex: '^<sys/param\.h>'
102     Priority: 2
103     SortPriority: 22
104   - Regex: '^<sys.*/'
105     Priority: 2
106     SortPriority: 23
107   - Regex: '^<vm/vm\.h>'
108     Priority: 3
109     SortPriority: 30
110   - Regex: '^<vm/'
111     Priority: 3
112     SortPriority: 31
113   - Regex: '^<machine/'
114     Priority: 4
115     SortPriority: 40
116   - Regex: '^<(x86|amd64|i386|xen)/'
117     Priority: 5
118     SortPriority: 50
119   - Regex: '^<dev/'
120     Priority: 6
121     SortPriority: 60
122   - Regex: '^<net.*/'
123     Priority: 7
124     SortPriority: 70
125   - Regex: '^<protocols/'
126     Priority: 7
127     SortPriority: 71
128   - Regex: '^<(fs|nfs(|client|server)|ufs)/'
129     Priority: 8
130     SortPriority: 80
131   - Regex: '^<[^/].*\.h'
132     Priority: 9
133     SortPriority: 90
134   - Regex: '^\".*\.h\"'
135     Priority: 10
136     SortPriority: 100
137 # LLVM's header include ordering style is almost the exact opposite of ours.
138 # Unfortunately, they have hard-coded their preferences into clang-format.
139 # Clobbering this regular expression to avoid matching prevents non-system
140 # headers from being forcibly moved to the top of the include list.
141 # http://llvm.org/docs/CodingStandards.html#include-style
142 IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING'
143 SortIncludes: true
144 KeepEmptyLinesAtTheStartOfBlocks: true
145 TypenameMacros:
146   - ARB_ELMTYPE
147   - ARB_HEAD
148   - ARB8_HEAD
149   - ARB16_HEAD
150   - ARB32_HEAD
151   - ARB_ENTRY
152   - ARB8_ENTRY
153   - ARB16_ENTRY
154   - ARB32_ENTRY
155   - LIST_CLASS_ENTRY
156   - LIST_CLASS_HEAD
157   - LIST_ENTRY
158   - LIST_HEAD
159   - QUEUE_TYPEOF
160   - RB_ENTRY
161   - RB_HEAD
162   - SLIST_CLASS_HEAD
163   - SLIST_CLASS_ENTRY
164   - SLIST_HEAD
165   - SLIST_ENTRY
166   - SMR_POINTER
167   - SPLAY_ENTRY
168   - SPLAY_HEAD
169   - STAILQ_CLASS_ENTRY
170   - STAILQ_CLASS_HEAD
171   - STAILQ_ENTRY
172   - STAILQ_HEAD
173   - TAILQ_CLASS_ENTRY
174   - TAILQ_CLASS_HEAD
175   - TAILQ_ENTRY
176   - TAILQ_HEAD