Skip to content

Commit 5e7eee4

Browse files
KarthikNayakgitster
authored andcommitted
clang-format: avoid spacing around bitfield colon
The spacing around colons is currently not standardized and as such we have the following practices in our code base: - Spacing around the colon `int bf : 1`: 146 instances - No spacing around the colon `int bf:1`: 148 instances - Spacing before the colon `int bf :1`: 6 instances - Spacing after the colon `int bf: 1`: 12 instances Let's formalize this by picking the most followed pattern and add the corresponding style to '.clang-format'. Signed-off-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e3ea432 commit 5e7eee4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ AlwaysBreakAfterReturnType: None
7272
BinPackArguments: true
7373
BinPackParameters: true
7474

75+
# Add no space around the bit field
76+
# unsigned bf:2;
77+
BitFieldColonSpacing: None
78+
7579
# Attach braces to surrounding context except break before braces on function
7680
# definitions.
7781
# void foo()

0 commit comments

Comments
 (0)