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