1
1
Here a few minimalistic coding rules for the CPROVER source tree.
2
2
3
3
# Whitespaces
4
+
5
+ Formatting is enforced using clang-format. For more information about this, see
6
+ ` COMPILING.md ` . A brief summary of the formatting rules is given below:
7
+
4
8
- Use 2 spaces indent, no tabs.
5
9
- No lines wider than 80 chars.
6
10
- When line is wider, do the following:
@@ -16,8 +20,7 @@ Here a few minimalistic coding rules for the CPROVER source tree.
16
20
even if the outer function call does.
17
21
- If a method is bigger than 50 lines, break it into parts.
18
22
- Put matching ` { } ` into the same column.
19
- - No spaces around operators (` = ` , ` + ` , ` == ` ...) Exceptions: Spaces around
20
- ` && ` , ` || ` and ` << `
23
+ - Spaces around binary operators (` = ` , ` + ` , ` == ` ...)
21
24
- Space after comma (parameter lists, argument lists, ...)
22
25
- Space after colon inside ` for `
23
26
- For pointers and references, the ` * ` /` & ` should be attached to the variable
@@ -27,10 +30,10 @@ Here a few minimalistic coding rules for the CPROVER source tree.
27
30
- No whitespaces in blank lines
28
31
- Put argument lists on next line (and indent 2 spaces) if too long
29
32
- Put parameters on separate lines (and indent 2 spaces) if too long
30
- - No whitespaces around colon for inheritance, put inherited into separate
31
- lines in case of multiple inheritance
32
- - The initializer list follows the constructor without a whitespace around the
33
- colon. Break line after the colon if required and indent members.
33
+ - Spaces around colon for inheritance, put inherited into separate lines in
34
+ case of multiple inheritance
35
+ - The initializer list follows the constructor with a whitespace around the
36
+ colon.
34
37
- ` if(...) ` , ` else ` , ` for(...) ` , ` do ` , and ` while(...) ` are always in a
35
38
separate line
36
39
- Break expressions in ` if ` , ` for ` , ` while ` if necessary and align them with
0 commit comments