]> git.cworth.org Git - apitrace/blob - DEVELOPMENT.markdown
Merge branch 'master' into d2d
[apitrace] / DEVELOPMENT.markdown
1 Coding Style
2 ============
3
4 XXX: These are mostly guidelines for new code, as some of existing hasn't been
5 updated to these conventions yet.
6
7 Whitespace (all languages):
8
9  * indentation is 4 spaces
10
11  * never use tabs as indents
12
13  * otherwise tab equals to 8 spaces
14
15  * separate classes with two empty lines
16
17 Naming convention:
18
19  * camelCase for functions/methods
20
21  * UpperCase for structures/classes
22
23  * lowercase for namespaces/modules
24
25  * `UPPER_CASE` for #defines
26
27 C++:
28
29  * enclose single statement `if` clauses in { }, specially for automatically
30    generated code
31
32  * } else {
33
34  * use inlines for functions/methods which are called with high-frequency
35
36 CMake:
37
38  * `lower_case`
39
40  * space between ( and precedent name
41
42
43 When in doubt, be consistent with the existing code.
44
45
46 Commit policy
47 =============
48
49 Feature development:
50
51 * Existing features in master branch should not degrade at any time, for any
52   platform.  (Unless it is not widely used and there is agreement.)
53
54 * It's fine to add new features for only some platforms.
55
56 * Non-trivial changes should be staged in a branch, to enable peer-review and
57   regression testing.  Branch should be deleted once code has been merged.
58
59 * Releases are tagged commits from master.  There are no stable branches.
60
61
62 Backwards compatibility:
63
64 * Backwards binary compatibility with old traces must be always maintained: all
65   tools, including glretrace, must handle old traces without regressions.
66
67 * No backwards compatibility guarantees for derived data (ASCII dumps, state,
68   images, etc).
69
70 * There should be no gratuitous change to command line tool interfaces, but no
71   guarantees are given.
72
73
74
75 Regression testing
76 ==================
77
78 There is a regression test suite under development in
79 https://github.com/apitrace/apitrace-tests .
80