@@ -32,6 +32,9 @@ AlignConsecutiveAssignments: false
3232# double b = 3.14;
3333AlignConsecutiveDeclarations : false
3434
35+ # Align consecutive macro definitions.
36+ AlignConsecutiveMacros : true
37+
3538# Align escaped newlines as far left as possible
3639# #define A \
3740# int aaaa; \
@@ -72,6 +75,10 @@ AlwaysBreakAfterReturnType: None
7275BinPackArguments : true
7376BinPackParameters : true
7477
78+ # Add no space around the bit field
79+ # unsigned bf:2;
80+ BitFieldColonSpacing : None
81+
7582# Attach braces to surrounding context except break before braces on function
7683# definitions.
7784# void foo()
@@ -83,9 +90,9 @@ BinPackParameters: true
8390BreakBeforeBraces : Linux
8491
8592# Break after operators
86- # int valuve = aaaaaaaaaaaaa +
87- # bbbbbb -
88- # ccccccccccc;
93+ # int value = aaaaaaaaaaaaa +
94+ # bbbbbb -
95+ # ccccccccccc;
8996BreakBeforeBinaryOperators : None
9097BreakBeforeTernaryOperators : false
9198
@@ -96,6 +103,14 @@ BreakStringLiterals: false
96103# Switch statement body is always indented one level more than case labels.
97104IndentCaseLabels : false
98105
106+ # Indents directives before the hash. Each level uses a single space for
107+ # indentation.
108+ # #if FOO
109+ # # include <foo>
110+ # #endif
111+ IndentPPDirectives : AfterHash
112+ PPIndentWidth : 1
113+
99114# Don't indent a function definition or declaration if it is wrapped after the
100115# type
101116IndentWrappedFunctionNames : false
@@ -108,11 +123,18 @@ PointerAlignment: Right
108123# x = (int32)y; not x = (int32) y;
109124SpaceAfterCStyleCast : false
110125
126+ # No space is inserted after the logical not operator
127+ SpaceAfterLogicalNot : false
128+
111129# Insert spaces before and after assignment operators
112130# int a = 5; not int a=5;
113131# a += 42; a+=42;
114132SpaceBeforeAssignmentOperators : true
115133
134+ # Spaces will be removed before case colon.
135+ # case 1: break; not case 1 : break;
136+ SpaceBeforeCaseColon : false
137+
116138# Put a space before opening parentheses only after control statement keywords.
117139# void f() {
118140# if (true) {
@@ -124,6 +146,14 @@ SpaceBeforeParens: ControlStatements
124146# Don't insert spaces inside empty '()'
125147SpaceInEmptyParentheses : false
126148
149+ # No space before first '[' in arrays
150+ # int a[5][5]; not int a [5][5];
151+ SpaceBeforeSquareBrackets : false
152+
153+ # No space will be inserted into {}
154+ # while (true) {} not while (true) { }
155+ SpaceInEmptyBlock : false
156+
127157# The number of spaces before trailing line comments (// - comments).
128158# This does not affect trailing block comments (/* - comments).
129159SpacesBeforeTrailingComments : 1
@@ -149,20 +179,30 @@ Cpp11BracedListStyle: false
149179
150180# A list of macros that should be interpreted as foreach loops instead of as
151181# function calls. Taken from:
152- # git grep -h '^#define [^[:space:]]*for_each[^[:space:]]*(' \
153- # | sed "s,^#define \([^[:space:]]*for_each[^[:space:]]*\)(.*$, - '\1'," \
154- # | sort | uniq
182+ # git grep -h '^#define [^[:space:]]*for_\?each[^[:space:]]*(' |
183+ # sed "s/^#define / - '/; s/(.*$/'/" | sort | uniq
155184ForEachMacros :
156- - ' for_each_abbrev'
157185 - ' for_each_builtin'
158186 - ' for_each_string_list_item'
159187 - ' for_each_ut'
160188 - ' for_each_wanted_builtin'
189+ - ' hashmap_for_each_entry'
190+ - ' hashmap_for_each_entry_from'
191+ - ' kh_foreach'
192+ - ' kh_foreach_value'
161193 - ' list_for_each'
162194 - ' list_for_each_dir'
163195 - ' list_for_each_prev'
164196 - ' list_for_each_prev_safe'
165197 - ' list_for_each_safe'
198+ - ' strintmap_for_each_entry'
199+ - ' strmap_for_each_entry'
200+ - ' strset_for_each_entry'
201+
202+ # A list of macros that should be interpreted as conditionals instead of as
203+ # function calls.
204+ IfMacros :
205+ - ' if_test'
166206
167207# The maximum number of consecutive empty lines to keep.
168208MaxEmptyLinesToKeep : 1
@@ -172,13 +212,14 @@ KeepEmptyLinesAtTheStartOfBlocks: false
172212
173213# Penalties
174214# This decides what order things should be done if a line is too long
175- PenaltyBreakAssignment : 10
176- PenaltyBreakBeforeFirstCallParameter : 30
177- PenaltyBreakComment : 10
215+ PenaltyBreakAssignment : 5
216+ PenaltyBreakBeforeFirstCallParameter : 5
217+ PenaltyBreakComment : 5
178218PenaltyBreakFirstLessLess : 0
179- PenaltyBreakString : 10
180- PenaltyExcessCharacter : 100
181- PenaltyReturnTypeOnItsOwnLine : 60
219+ PenaltyBreakOpenParenthesis : 300
220+ PenaltyBreakString : 5
221+ PenaltyExcessCharacter : 10
222+ PenaltyReturnTypeOnItsOwnLine : 300
182223
183224# Don't sort #include's
184225SortIncludes : false
0 commit comments