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