]> git.ipfire.org Git - thirdparty/git.git/commitdiff
clang-format: avoid spacing around bitfield colon
authorKarthik Nayak <karthik.188@gmail.com>
Tue, 23 Jul 2024 08:21:07 +0000 (10:21 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 23 Jul 2024 16:56:49 +0000 (09:56 -0700)
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>
.clang-format

index 5e128519bfa7b7dde8cd96738f3ad7b311547bc1..803b274dd5762ba7d6b9e2211f428abd0e04aba7 100644 (file)
@@ -72,6 +72,10 @@ AlwaysBreakAfterReturnType: None
 BinPackArguments: true
 BinPackParameters: true
 
+# Add no space around the bit field
+# unsigned bf:2;
+BitFieldColonSpacing: None
+
 # Attach braces to surrounding context except break before braces on function
 # definitions.
 # void foo()