1# $FreeBSD$
2# Basic .clang-format
3---
4BasedOnStyle: WebKit
5AlignAfterOpenBracket: DontAlign
6AlignConsecutiveAssignments: false
7AlignConsecutiveDeclarations: false
8AlignEscapedNewlines: Left
9AlignOperands: false
10AlignTrailingComments: true
11AllowAllArgumentsOnNextLine: false
12AllowAllParametersOfDeclarationOnNextLine: false
13AllowShortBlocksOnASingleLine: Never
14AllowShortCaseLabelsOnASingleLine: false
15AllowShortFunctionsOnASingleLine: InlineOnly
16AllowShortIfStatementsOnASingleLine: Never
17AllowShortLoopsOnASingleLine: false
18AlwaysBreakAfterReturnType: TopLevelDefinitions
19AlwaysBreakBeforeMultilineStrings: false
20AlwaysBreakTemplateDeclarations: MultiLine
21BinPackArguments: true
22BinPackParameters: true
23BreakBeforeBinaryOperators: None
24BreakBeforeBraces: WebKit
25BreakBeforeTernaryOperators: false
26# TODO: BreakStringLiterals can cause very strange formatting so turn it off?
27BreakStringLiterals: false
28# Prefer:
29# some_var = function(arg1,
30#    arg2)
31# over:
32# some_var =
33#     function(arg1, arg2)
34PenaltyBreakAssignment: 100
35# Prefer:
36# some_long_function(arg1, arg2
37#     arg3)
38# over:
39# some_long_function(
40#     arg1, arg2, arg3)
41PenaltyBreakBeforeFirstCallParameter: 100
42CompactNamespaces: true
43DerivePointerAlignment: false
44DisableFormat: false
45ForEachMacros:
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  - CPU_FOREACH
56  - FOREACH_THREAD_IN_PROC
57  - FOREACH_PROC_IN_SYSTEM
58  - FOREACH_PRISON_CHILD
59  - FOREACH_PRISON_DESCENDANT
60  - FOREACH_PRISON_DESCENDANT_LOCKED
61  - FOREACH_PRISON_DESCENDANT_LOCKED_LEVEL
62  - MNT_VNODE_FOREACH_ALL
63  - MNT_VNODE_FOREACH_ACTIVE
64  - RB_FOREACH
65  - RB_FOREACH_FROM
66  - RB_FOREACH_SAFE
67  - RB_FOREACH_REVERSE
68  - RB_FOREACH_REVERSE_FROM
69  - RB_FOREACH_REVERSE_SAFE
70  - SLIST_FOREACH
71  - SLIST_FOREACH_FROM
72  - SLIST_FOREACH_FROM_SAFE
73  - SLIST_FOREACH_SAFE
74  - SLIST_FOREACH_PREVPTR
75  - SPLAY_FOREACH
76  - LIST_FOREACH
77  - LIST_FOREACH_FROM
78  - LIST_FOREACH_FROM_SAFE
79  - LIST_FOREACH_SAFE
80  - STAILQ_FOREACH
81  - STAILQ_FOREACH_FROM
82  - STAILQ_FOREACH_FROM_SAFE
83  - STAILQ_FOREACH_SAFE
84  - TAILQ_FOREACH
85  - TAILQ_FOREACH_FROM
86  - TAILQ_FOREACH_FROM_SAFE
87  - TAILQ_FOREACH_REVERSE
88  - TAILQ_FOREACH_REVERSE_FROM
89  - TAILQ_FOREACH_REVERSE_FROM_SAFE
90  - TAILQ_FOREACH_REVERSE_SAFE
91  - TAILQ_FOREACH_SAFE
92  - VM_MAP_ENTRY_FOREACH
93  - VM_PAGE_DUMP_FOREACH
94IndentCaseLabels: false
95IndentPPDirectives: None
96Language: Cpp
97NamespaceIndentation: None
98PointerAlignment: Right
99ContinuationIndentWidth: 4
100IndentWidth: 8
101TabWidth: 8
102ColumnLimit: 80
103UseTab: Always
104SpaceAfterCStyleCast: false
105# LLVM's header include ordering style is almost the exact opposite of ours.
106# Unfortunately, they have hard-coded their preferences into clang-format.
107# Clobbering this regular expression to avoid matching prevents non-system
108# headers from being forcibly moved to the top of the include list.
109# http://llvm.org/docs/CodingStandards.html#include-style
110IncludeIsMainRegex: 'BLAH_DONT_MATCH_ANYTHING'
111SortIncludes: true
112KeepEmptyLinesAtTheStartOfBlocks: true
113TypenameMacros:
114  - ARB_ELMTYPE
115  - ARB_HEAD
116  - ARB8_HEAD
117  - ARB16_HEAD
118  - ARB32_HEAD
119  - ARB_ENTRY
120  - ARB8_ENTRY
121  - ARB16_ENTRY
122  - ARB32_ENTRY
123  - LIST_CLASS_ENTRY
124  - LIST_CLASS_HEAD
125  - LIST_ENTRY
126  - LIST_HEAD
127  - QUEUE_TYPEOF
128  - RB_ENTRY
129  - RB_HEAD
130  - SLIST_CLASS_HEAD
131  - SLIST_CLASS_ENTRY
132  - SLIST_HEAD
133  - SLIST_ENTRY
134  - SMR_POINTER
135  - SPLAY_ENTRY
136  - SPLAY_HEAD
137  - STAILQ_CLASS_ENTRY
138  - STAILQ_CLASS_HEAD
139  - STAILQ_ENTRY
140  - STAILQ_HEAD
141  - TAILQ_CLASS_ENTRY
142  - TAILQ_CLASS_HEAD
143  - TAILQ_ENTRY
144  - TAILQ_HEAD
145MaxEmptyLinesToKeep: 2
146