CodingGuidelines: mention C whitespace rules
We are fairly consistent about these, so most are covered by "follow existing style", but it doesn't hurt to be explicit. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Feb 28, 2014 at 01:17 UTC
f57b6cfdf7b395adc6b3c813109c2eb53e93809a
1 file changed
+11
Documentation/CodingGuidelines
+11
@@ -126,6 +126,17 @@ For C programs:
126
"char * string". This makes it easier to understand code
127
like "char *string, c;".
128
129
+ - Use whitespace around operators and keywords, but not inside
130
+ parentheses and not around functions. So:
131
+
132
+ while (condition)
133
+ func(bar + 1);
134
+
135
+ and not:
136
+
137
+ while( condition )
138
+ func (bar+1);
139
+
140
- We avoid using braces unnecessarily. I.e.
141
142
if (bla) {