Merge commit 'origin/master' into btdun
[NetworkManager.git] / CONTRIBUTING
1 Guidelines for Contributing:
2
3 1) Platform-specific functionality (for example, location of binaries that
4 NetworkManager calls, or functionality used only on some platforms or
5 distribution, like resolvconf) should be configurable at build time, with the
6 normal autoconf mechanisms for putting a #define in config.h (AC_DEFINE), then
7 with #ifdef MY_DEFINE / #endif in the code.
8
9 2) Coding standards are generally GNOME coding standards, with these exceptions:
10         a) 4 space tabs  (_not_ 8-space tabs)
11         b) REAL tabs (_not_ a mix of tabs and spaces in the initial indent)
12         c) spaces used to align continuation lines past the indent point of the
13            first statement line, like so:
14
15                 if (some_really_really_long_variable_name &&
16                     another_really_really_long_variable_name) {
17                         ...
18                 }
19
20 * Keep a space between the function name and the opening '('.
21     GOOD: g_strdup (x)
22     BAD:  g_strdup(x)
23
24 * C-style comments, except for FIXMEs.
25     GOOD: f(x);  /* comment */
26     BAD:  f(x);  // comment
27
28     GOOD: // FIXME: juice the gooblygok
29     BAD:  /* FIXME: juice the gooblygok */
30
31 * Keep assignments in the variable declaration area pretty short.
32     GOOD: MyObject *object;
33     BAD: MyObject *object = complex_and_long_init_function(arg1, arg2, arg3);
34
35 * 80-cols is a guideline, don't make the code uncomfortable in order to fit in
36   less than 80 cols.
37
38 * Constants are CAPS_WITH_UNDERSCORES and use the preprocessor.
39     GOOD: #define MY_CONSTANT 42
40     BAD:  static const unsigned myConstant = 42;
41