Skip to content

Commit f57b6cf

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7bbc4e8 commit f57b6cf

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Documentation/CodingGuidelines

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ For C programs:
126126
"char * string". This makes it easier to understand code
127127
like "char *string, c;".
128128

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+
129140
- We avoid using braces unnecessarily. I.e.
130141

131142
if (bla) {

0 commit comments

Comments
 (0)