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 <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karthik Nayak committed
Jul 23, 2024 at 10:21 UTC
5e7eee46a3a57f13a1bd080fef777a0e5aed4cb9
1 file changed
+4
.clang-format
+4
@@ -72,6 +72,10 @@ AlwaysBreakAfterReturnType: None
72
BinPackArguments: true
73
BinPackParameters: true
74
75
+# Add no space around the bit field
76
+# unsigned bf:2;
77
+BitFieldColonSpacing: None
78
+
79
# Attach braces to surrounding context except break before braces on function
80
# definitions.
81
# void foo()