2004-08-13 15:41:31 +00:00
|
|
|
Guidelines for Contributing:
|
|
|
|
|
2008-11-19 23:41:08 +00:00
|
|
|
1) Platform-specific functionality (for example, location of binaries that
|
|
|
|
NetworkManager calls, or functionality used only on some platforms or
|
|
|
|
distribution, like resolvconf) should be configurable at build time, with the
|
|
|
|
normal autoconf mechanisms for putting a #define in config.h (AC_DEFINE), then
|
|
|
|
with #ifdef MY_DEFINE / #endif in the code.
|
2004-08-13 15:41:31 +00:00
|
|
|
|
2008-11-19 23:41:08 +00:00
|
|
|
2) Coding standards are generally GNOME coding standards, with these exceptions:
|
|
|
|
a) 4 space tabs (_not_ 8-space tabs)
|
|
|
|
b) REAL tabs (_not_ a mix of tabs and spaces in the initial indent)
|
|
|
|
c) spaces used to align continuation lines past the indent point of the
|
|
|
|
first statement line, like so:
|
|
|
|
|
|
|
|
if (some_really_really_long_variable_name &&
|
|
|
|
another_really_really_long_variable_name) {
|
2004-08-13 15:41:31 +00:00
|
|
|
...
|
|
|
|
}
|
2008-11-19 23:41:08 +00:00
|
|
|
|
2009-10-07 19:28:10 +00:00
|
|
|
* Keep a space between the function name and the opening '('.
|
|
|
|
GOOD: g_strdup (x)
|
|
|
|
BAD: g_strdup(x)
|
|
|
|
|
2016-02-04 15:50:42 +00:00
|
|
|
* C-style comments
|
2009-10-07 19:28:10 +00:00
|
|
|
GOOD: f(x); /* comment */
|
|
|
|
BAD: f(x); // comment
|
|
|
|
|
|
|
|
* Keep assignments in the variable declaration area pretty short.
|
|
|
|
GOOD: MyObject *object;
|
|
|
|
BAD: MyObject *object = complex_and_long_init_function(arg1, arg2, arg3);
|
|
|
|
|
|
|
|
* 80-cols is a guideline, don't make the code uncomfortable in order to fit in
|
|
|
|
less than 80 cols.
|
|
|
|
|
|
|
|
* Constants are CAPS_WITH_UNDERSCORES and use the preprocessor.
|
|
|
|
GOOD: #define MY_CONSTANT 42
|
|
|
|
BAD: static const unsigned myConstant = 42;
|
|
|
|
|
2017-07-17 21:53:17 +00:00
|
|
|
3) Legal:
|
|
|
|
|
|
|
|
All original contributions to NetworkManager are licensed under the
|
|
|
|
GNU General Public License, version 2 or later, or, if another license
|
|
|
|
is specified as governing the file or directory being modified, such
|
|
|
|
other license. See the file COPYING in this directory for details.
|
|
|
|
|
|
|
|
|
|
|
|
|