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: 0
\r
15 ConstructorInitializerIndentWidth: 4
\r
16 AccessModifierOffset: -4
\r
18 # Align parameters on the open bracket
\r
19 # someLongFunction(argument1,
\r
21 AlignAfterOpenBracket: Align
\r
23 # Don't align consecutive assignments
\r
26 AlignConsecutiveAssignments: false
\r
28 # Don't align consecutive declarations
\r
31 AlignConsecutiveDeclarations: false
\r
33 # Align escaped newlines as far left as possible
\r
38 AlignEscapedNewlines: Left
\r
40 # Align operands of binary and ternary expressions
\r
41 # int aaa = bbbbbbbbbbb +
\r
45 # Don't align trailing comments
\r
46 # int a; // Comment a
\r
47 # int b = 2; // Comment b
\r
48 AlignTrailingComments: false
\r
50 # By default don't allow putting parameters onto the next line
\r
51 # myFunction(foo, bar, baz);
\r
52 AllowAllParametersOfDeclarationOnNextLine: false
\r
54 # Don't allow short braced statements to be on a single line
\r
55 # if (a) not if (a) return;
\r
57 AllowShortBlocksOnASingleLine: false
\r
58 AllowShortCaseLabelsOnASingleLine: false
\r
59 AllowShortFunctionsOnASingleLine: Inline
\r
60 AllowShortIfStatementsOnASingleLine: false
\r
61 AllowShortLoopsOnASingleLine: false
\r
63 # By default don't add a line break after the return type of top-level functions
\r
65 AlwaysBreakAfterReturnType: None
\r
67 # Pack as many parameters or arguments onto the same line as possible
\r
68 # int myFunction(int aaaaaaaaaaaa, int bbbbbbbb,
\r
70 BinPackArguments: true
\r
71 BinPackParameters: true
\r
73 # Attach braces to surrounding context except break before braces on function
\r
84 BreakBeforeBraces: Custom
\r
88 SplitEmptyFunction: false
\r
90 AfterControlStatement: true
\r
92 AfterNamespace: true
\r
94 AfterExternBlock: true
\r
97 # TODO: After lambda is missing in clang-format definition ATM
\r
99 # The constructor initializers style to use.
\r
103 BreakConstructorInitializers: BeforeComma
\r
104 #BreakInheritanceList: BeforeComma # not yet supported by VS2017
\r
106 # Break after operators
\r
107 # int valuve = aaaaaaaaaaaaa +
\r
110 BreakBeforeBinaryOperators: None
\r
111 BreakBeforeTernaryOperators: false
\r
113 # Don't break string literals
\r
114 BreakStringLiterals: false
\r
116 # Use the same indentation level as for the switch statement.
\r
117 # Switch statement body is always indented one level more than case labels.
\r
118 IndentCaseLabels: false
\r
120 # Don't indent a function definition or declaration if it is wrapped after the
\r
122 IndentWrappedFunctionNames: false
\r
124 # Align pointer to the left
\r
126 PointerAlignment: Left
\r
128 # Don't insert a space after a cast
\r
129 # x = (int32)y; not x = (int32) y;
\r
130 SpaceAfterCStyleCast: false
\r
132 # Insert spaces before and after assignment operators
\r
133 # int a = 5; not int a=5;
\r
135 SpaceBeforeAssignmentOperators: true
\r
137 # Put a space before opening parentheses only after control statement keywords.
\r
145 SpaceBeforeParens: ControlStatements
\r
147 # Don't insert spaces inside empty '()'
\r
148 SpaceInEmptyParentheses: false
\r
150 # The number of spaces before trailing line comments (// - comments).
\r
151 # This does not affect trailing block comments (/* - comments).
\r
152 SpacesBeforeTrailingComments: 1
\r
154 # Don't insert spaces in casts
\r
155 # x = (int32) y; not x = ( int32 ) y;
\r
156 SpacesInCStyleCastParentheses: false
\r
158 # Insert spaces inside container literals
\r
159 # var arr = [ 1, 2, 3 ]; not var arr = [1, 2, 3];
\r
160 SpacesInContainerLiterals: true
\r
162 # Don't insert spaces after '(' or before ')'
\r
163 # f(arg); not f( arg );
\r
164 SpacesInParentheses: false
\r
166 # Don't insert spaces after '[' or before ']'
\r
167 # int a[5]; not int a[ 5 ];
\r
168 SpacesInSquareBrackets: false
\r
170 # Insert a space after '{' and before '}' in struct initializers
\r
171 Cpp11BracedListStyle: false
\r
173 # A list of macros that should be interpreted as foreach loops instead of as
\r
175 #ForEachMacros: ['for_each_string_list_item']
\r
177 # The maximum number of consecutive empty lines to keep.
\r
178 MaxEmptyLinesToKeep: 1
\r
180 # No empty line at the start of a block.
\r
181 KeepEmptyLinesAtTheStartOfBlocks: false
\r
183 # Don't sort #include's
\r
184 SortIncludes: false
\r
186 # Don't insert spaces after < and before > in template argument lists
\r
187 # static_cast<int>(arg);
\r
188 # std::function<void(int)> fct;
\r
189 SpacesInAngles: false
\r
191 # Indent certain blocks
\r
192 MacroBlockBegin: "^BEGIN_MESSAGE_MAP|BEGIN_TEMPLATE_MESSAGE_MAP"
\r
193 MacroBlockEnd: "^END_MESSAGE_MAP"
\r
195 #BreakTemplateDeclarationsStyle: Yes # not yet supported by VS2017
\r