HACKING 1.12 KB
Newer Older
Jorn Baayen's avatar
Jorn Baayen committed
1
2
3
In order to keep the code nice and clean we have a few requirements you'll
need to stick to in order to get your patch accepted:

Colin Walters's avatar
Update.    
Colin Walters committed
4
- send unified diffs (-u option to patch)
Jorn Baayen's avatar
Jorn Baayen committed
5
- use 8-space tabs for indentation
6
7
- curly brackets are NOT on a new line, except for function definitions.
  (we are slowly converting the code)
8
9
10
11
- if statements are written like this: "if (this != that)"
- g_list_next/previous is preferred to list->next or list->previous
- every function should have a prototype
- callback functions have a suffix _cb
Colin Walters's avatar
Update.    
Colin Walters committed
12
- Code must compile with -Wall -Werror
13

14
15
16
17
18
19
20
  Important comment blocks are written like this:
  
/**
 * bla_bla_cb: This is an example comment block
 */

  Here is a correctly indented code sample:
21
22
23
24
25
26
27

void
foo (const char *bla, gpointer cow)
{
	if (!strcmp (bla, cow)) {
		g_print ("moo!");
		return;
28
29
30
31
32
33
	} else {
		do_something (cow);	
		do_something_else (bla, cow);

	if (foo)
	    return;
34
35
36
37

	...
}	

Colin Walters's avatar
Colin Walters committed
38
39
40
You may commit small, obvious fixes to this module.  Anything larger
should be run by Colin Walters <walters@debian.org>, unless you
know I've given you blanket commit permission.
41
42

arch-tag: How to hack Rhythmbox and submit patches