]> git.saurik.com Git - apple/xnu.git/blame - .clang-format
xnu-3789.41.3.tar.gz
[apple/xnu.git] / .clang-format
CommitLineData
3e170ce0
A
1# Format of this file is YAML
2# Minimum clang-format version required: clang-format version 3.6.0
3# Detailed description of options available at http://clang.llvm.org/docs/ClangFormatStyleOptions.html
4
5AlignEscapedNewlinesLeft: true
6# Bad:
7# void foo() {
8# someFunction();
9# someOtherFunction();
10# }
11# Good:
12# void foo() {
13# someFunction();
14# someOtherFunction();
15# }
16
17AlignTrailingComments: true
18# align all comments to right based of //
19# == Avoid using // based comments altogether ==
20
21AllowAllParametersOfDeclarationOnNextLine: true
22# allow funtion definition as
23# someFunction(foo,
24# bar,
25# baz);
26
27AlignConsecutiveAssignments: true
28# aligns consecutive assignments with '=' operator
29
30AllowShortBlocksOnASingleLine: true
31# single statement block can be merged on one line
32# e.g if (a) { return; }
33
34AllowShortCaseLabelsOnASingleLine: false
35# Single statement case statements should be on their own lines
36
37AllowShortFunctionsOnASingleLine: None
38# Bad:
39# int foo() { return 123; }
40
41AllowShortIfStatementsOnASingleLine: false
42# Bad:
43# if (someOtherVar) return;
44# Good:
45# if (someOtherVar)
46# return;
47
48AllowShortLoopsOnASingleLine: false
49# Bad:
50# while(i>0) i--;
51# Good:
52# while(i>0) {
53# i--;
54# }
55
56AlwaysBreakAfterDefinitionReturnType: true
57# Ensures return type is one its own line
58# e.g. unsigned int
59# function(char param) { }
60
61AlwaysBreakBeforeMultilineStrings: true
62# multine strings should begin on new line
63
64BinPackArguments: true
65BinPackParameters: false
66# functions arguments should all be on one line or have a single line for each param
67
68BreakBeforeBinaryOperators: None
69# break for new line after binary operator in case of length is over ColumnLimit
70# e.g.
71# int foo = bar +
72# baz;
73
74BreakBeforeBraces: Linux
75# Always attach braces to surrounding context except -
76# break before braces on function, namespace and class definitions
77
78ColumnLimit: 132
79# every body has wide screen now. 132 seems to be reasonable limit now.
80
81IndentCaseLabels: false
82# case labels have same indentation as switch statement.
83
84IndentWidth: 4
85# 4 spaces for indentation
86TabWidth: 4
87# tabwidth is 4 spaces
88
89UseTab: ForIndentation
90# tab for indentation only. All alignment should happen with spaces
91# Simple rule to check.
92# No tabs allowed after first 'non-tab' character in a line
93
94IndentWrappedFunctionNames: false
95KeepEmptyLinesAtTheStartOfBlocks: false
96# remove excess empty lines at start of blocks.
97
98PointerAlignment: Middle
99
100SpaceAfterCStyleCast: false
101# No space after (cast). E.g
102# int blah = (int)((void *)foo + bar)
103
104SpaceBeforeAssignmentOperators: true
105# Assignment = should be seperated by spaces on both sides.
106
107SpaceBeforeParens: ControlStatements
39037602
A
108# for control statements a space is required before '('
109# Bad: for() { statement; }
110# Good: for () { statement; }
111# This setting distinguishes functions() from keywords like 'if' and 'for'.
3e170ce0
A
112
113SpaceInEmptyParentheses: false
114# No spaces required for empty ()
115
116SpacesInCStyleCastParentheses: false
117# No spaces required for (unsigned int) type cast
118
119SpacesInParentheses: false
120
121SpacesInSquareBrackets: false
122# No spaces in [count] style invocations of []