1 # This file is an example configuration for clang-format 5.0.
\r
3 # Note that this style definition should only be understood as a hint
\r
4 # for writing new code. The rules are still work-in-progress and does
\r
5 # not yet exactly match the style we have in the existing code.
\r
7 # C Language specifics
\r
14 ContinuationIndentWidth: 4
\r
15 ConstructorInitializerIndentWidth: 4
\r
17 # Align parameters on the open bracket
\r
18 # someLongFunction(argument1,
\r
20 AlignAfterOpenBracket: DontAlign
\r
22 # Don't align consecutive assignments
\r
25 AlignConsecutiveAssignments: false
\r
27 # Align consecutive declarations
\r
30 AlignConsecutiveDeclarations: false
\r
32 # Align escaped newlines as far left as possible
\r
37 AlignEscapedNewlines: Left
\r
39 # Align operands of binary and ternary expressions
\r
40 # int aaa = bbbbbbbbbbb +
\r
44 # Don't align trailing comments
\r
45 # int a; // Comment a
\r
46 # int b = 2; // Comment b
\r
47 AlignTrailingComments: false
\r
49 # By default allow putting parameters onto the next line
\r
50 # myFunction(foo, bar, baz);
\r
51 AllowAllParametersOfDeclarationOnNextLine: true
\r
53 # Don't allow short braced statements to be on a single line
\r
54 # if (a) not if (a) return;
\r
56 AllowShortBlocksOnASingleLine: false
\r
57 AllowShortCaseLabelsOnASingleLine: false
\r
58 AllowShortFunctionsOnASingleLine: Inline
\r
59 AllowShortIfStatementsOnASingleLine: false
\r
60 AllowShortLoopsOnASingleLine: false
\r
62 # By default don't add a line break after the return type of top-level functions
\r
64 AlwaysBreakAfterReturnType: None
\r
66 # Pack as many arguments onto the same line as possible, but not for parameters
\r
67 # int myFunction(int aaaaaaaaaaaa,
\r
70 BinPackArguments: false
\r
71 BinPackParameters: true
\r
73 # Attach braces to surrounding context except break before braces on function
\r
80 BreakBeforeBraces: Linux
\r
82 # Break after operators
\r
83 # int valuve = aaaaaaaaaaaaa +
\r
86 BreakBeforeBinaryOperators: None
\r
87 BreakBeforeTernaryOperators: false
\r
89 # Don't break string literals
\r
90 BreakStringLiterals: false
\r
92 # Use the one more indentation level as for the switch statement.
\r
93 IndentCaseLabels: true
\r
95 # Don't indent a function definition or declaration if it is wrapped after the
\r
97 IndentWrappedFunctionNames: false
\r
99 # Align pointer to the right
\r
101 PointerAlignment: Right
\r
103 # Don't insert a space after a cast
\r
104 # x = (int32)y; not x = (int32) y;
\r
105 SpaceAfterCStyleCast: false
\r
107 # Insert spaces before and after assignment operators
\r
108 # int a = 5; not int a=5;
\r
110 SpaceBeforeAssignmentOperators: true
\r
112 # Put a space before opening parentheses only after control statement keywords.
\r
120 SpaceBeforeParens: ControlStatements
\r
122 # Don't insert spaces inside empty '()'
\r
123 SpaceInEmptyParentheses: false
\r
125 # The number of spaces before trailing line comments (// - comments).
\r
126 # This does not affect trailing block comments (/* - comments).
\r
127 SpacesBeforeTrailingComments: 1
\r
129 # Don't insert spaces in casts
\r
130 # x = (int32) y; not x = ( int32 ) y;
\r
131 SpacesInCStyleCastParentheses: false
\r
133 # Don't insert spaces inside container literals
\r
134 # var arr = [ 1, 2, 3 ]; not var arr = [1, 2, 3];
\r
135 SpacesInContainerLiterals: true
\r
137 # Don't insert spaces after '(' or before ')'
\r
138 # f(arg); not f( arg );
\r
139 SpacesInParentheses: false
\r
141 # Don't insert spaces after '[' or before ']'
\r
142 # int a[5]; not int a[ 5 ];
\r
143 SpacesInSquareBrackets: false
\r
145 # Insert a space after '{' and before '}' in struct initializers
\r
146 Cpp11BracedListStyle: false
\r
148 # A list of macros that should be interpreted as foreach loops instead of as
\r
150 #ForEachMacros: ['for_each_string_list_item']
\r
152 # The maximum number of consecutive empty lines to keep.
\r
153 MaxEmptyLinesToKeep: 1
\r
155 # No empty line at the start of a block.
\r
156 KeepEmptyLinesAtTheStartOfBlocks: false
\r
158 # Don't sort #include's
\r
159 SortIncludes: false
\r
161 # Indent certain blocks
\r
162 MacroBlockBegin: ''
\r