CodingGuidelines: mention C whitespace rules
authorJeff King <peff@peff.net>
Fri, 28 Feb 2014 06:17:25 +0000 (01:17 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Feb 2014 20:53:50 +0000 (12:53 -0800)
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>
Documentation/CodingGuidelines
index ef67b53f721f28e5442c00273dec5f1582f555be..ed432a80ca62eeb6a75e08870d9c8f8eaf4ab6d8 100644 (file)
@@ -126,6 +126,17 @@ For C programs:
    "char * string".  This makes it easier to understand code
    like "char *string, c;".
 
+ - Use whitespace around operators and keywords, but not inside
+   parentheses and not around functions. So:
+
+        while (condition)
+               func(bar + 1);
+
+   and not:
+
+        while( condition )
+               func (bar+1);
+
  - We avoid using braces unnecessarily.  I.e.
 
        if (bla) {