1 # This file is an example configuration for clang-format 5.0.
3 # Note that this style definition should only be understood as a hint
4 # for writing new code. The rules are still work-in-progress and does
5 # not yet exactly match the style we have in the existing code.
10 # Use tabs whenever we need to fill whitespace that spans at least from one tab
11 # stop to the next one.
13 # These settings are mirrored in .editorconfig. Keep them in sync.
14 UseTab: ForIndentation
17 ContinuationIndentWidth: 8
20 AlignAfterOpenBracket: AlwaysBreak
21 AlignEscapedNewlines: Left
22 AlignTrailingComments: false
24 # Allow putting parameters onto the next line
25 AllowAllArgumentsOnNextLine: false
26 AllowAllParametersOfDeclarationOnNextLine: false
28 # Don't allow short braced statements to be on a single line
29 # if (a) not if (a) return;
31 AllowShortBlocksOnASingleLine: false
32 AllowShortFunctionsOnASingleLine: None
33 AllowShortLoopsOnASingleLine: false
34 AllowShortLambdasOnASingleLine: None
36 # Pack as many parameters or arguments onto the same line as possible
37 # int myFunction(int aaaaaaaaaaaa, int bbbbbbbb,
39 BinPackArguments: true
40 BinPackParameters: false
42 BreakBeforeBraces: Linux
43 BreakBeforeBinaryOperators: None
44 BreakBeforeTernaryOperators: false
45 BreakStringLiterals: false
47 # The number of spaces before trailing line comments (// - comments).
48 # This does not affect trailing block comments (/* - comments).
49 SpacesBeforeTrailingComments: 1
51 # Don't insert spaces in casts
52 # x = (int32) y; not x = ( int32 ) y;
53 SpacesInCStyleCastParentheses: false
55 # Don't insert spaces inside container literals
56 # var arr = [1, 2, 3]; not var arr = [ 1, 2, 3 ];
57 SpacesInContainerLiterals: false
59 # Don't insert spaces after '(' or before ')'
60 # f(arg); not f( arg );
61 SpacesInParentheses: false
63 # Don't insert spaces after '[' or before ']'
64 # int a[5]; not int a[ 5 ];
65 SpacesInSquareBrackets: false
67 # Insert a space after '{' and before '}' in struct initializers
68 Cpp11BracedListStyle: false
70 # A list of macros that should be interpreted as foreach loops instead of as
74 - 'git_vector_foreach'
76 # The maximum number of consecutive empty lines to keep.
77 MaxEmptyLinesToKeep: 1
79 # No empty line at the start of a block.
80 KeepEmptyLinesAtTheStartOfBlocks: false
83 # This decides what order things should be done if a line is too long
84 PenaltyBreakAssignment: 10
85 PenaltyBreakBeforeFirstCallParameter: 30
86 PenaltyBreakComment: 10
87 PenaltyBreakFirstLessLess: 0
88 PenaltyBreakString: 10
89 PenaltyExcessCharacter: 100
90 PenaltyReturnTypeOnItsOwnLine: 60