]> git.proxmox.com Git - libgit2.git/blame - .clang-format
Explicitly set USE_SSH=ON
[libgit2.git] / .clang-format
CommitLineData
ad5611d8
TR
1# This file is an example configuration for clang-format 5.0.
2#
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.
6
7# C Language specifics
8Language: Cpp
9
10# Use tabs whenever we need to fill whitespace that spans at least from one tab
11# stop to the next one.
12#
13# These settings are mirrored in .editorconfig. Keep them in sync.
14UseTab: ForIndentation
15TabWidth: 8
16IndentWidth: 8
17ContinuationIndentWidth: 8
18ColumnLimit: 80
19
20AlignAfterOpenBracket: AlwaysBreak
21AlignEscapedNewlines: Left
22AlignTrailingComments: false
23
24# Allow putting parameters onto the next line
25AllowAllArgumentsOnNextLine: false
26AllowAllParametersOfDeclarationOnNextLine: false
27
28# Don't allow short braced statements to be on a single line
29# if (a) not if (a) return;
30# return;
31AllowShortBlocksOnASingleLine: false
32AllowShortFunctionsOnASingleLine: None
33AllowShortLoopsOnASingleLine: false
34AllowShortLambdasOnASingleLine: None
35
36# Pack as many parameters or arguments onto the same line as possible
37# int myFunction(int aaaaaaaaaaaa, int bbbbbbbb,
38# int cccc);
39BinPackArguments: true
40BinPackParameters: false
41
42BreakBeforeBraces: Linux
43BreakBeforeBinaryOperators: None
44BreakBeforeTernaryOperators: false
45BreakStringLiterals: false
46
47# The number of spaces before trailing line comments (// - comments).
48# This does not affect trailing block comments (/* - comments).
49SpacesBeforeTrailingComments: 1
50
51# Don't insert spaces in casts
52# x = (int32) y; not x = ( int32 ) y;
53SpacesInCStyleCastParentheses: false
54
55# Don't insert spaces inside container literals
56# var arr = [1, 2, 3]; not var arr = [ 1, 2, 3 ];
57SpacesInContainerLiterals: false
58
59# Don't insert spaces after '(' or before ')'
60# f(arg); not f( arg );
61SpacesInParentheses: false
62
63# Don't insert spaces after '[' or before ']'
64# int a[5]; not int a[ 5 ];
65SpacesInSquareBrackets: false
66
67# Insert a space after '{' and before '}' in struct initializers
68Cpp11BracedListStyle: false
69
70# A list of macros that should be interpreted as foreach loops instead of as
71# function calls.
72ForEachMacros:
73 - 'git_array_foreach'
74 - 'git_vector_foreach'
75
76# The maximum number of consecutive empty lines to keep.
77MaxEmptyLinesToKeep: 1
78
79# No empty line at the start of a block.
80KeepEmptyLinesAtTheStartOfBlocks: false
81
82# Penalties
83# This decides what order things should be done if a line is too long
84PenaltyBreakAssignment: 10
85PenaltyBreakBeforeFirstCallParameter: 30
86PenaltyBreakComment: 10
87PenaltyBreakFirstLessLess: 0
88PenaltyBreakString: 10
89PenaltyExcessCharacter: 100
90PenaltyReturnTypeOnItsOwnLine: 60
91
92SortIncludes: false