* updated the HACKING instructions

This commit is contained in:
djcb
2012-03-24 11:17:11 +02:00
parent 3fb7e5d6ff
commit d44cb572ef

20
HACKING
View File

@ -7,10 +7,12 @@
so as long as any new code 'fits in', it should go a long way in satisfying
them.
I should add some notes for the Lisp/Scheme code as well...
** Coding style
For consistency and, even more important, to keep things understandable, mu
follows the following rules:
attempts to follow the following rules:
1. basic code layout is like in the Linux kernel coding style, with the '{'
on the same line as the statement, except for functions. Tabs/spaces
@ -18,10 +20,9 @@
2. lines must not exceed 80 characters (C) or 100 characters (C++)
3. functions must not exceed 40 lines (there could be rare exceptions,
currently there are none in mu), and 30 lines is already pretty long. You
can easily check if any functions violate this rule with 'make line33',
which lists all functions with more than 33 non-comment lines.
3. functions must not exceed 35 lines. You can easily check if any functions
violate this rule with 'make line35', which lists all functions with more
than 35 non-comment lines.
4. source files should not exceed 1000 lines
@ -31,7 +32,8 @@
can use 'make cc10' to list all functions that violate this rule; there
should be none.
6. filenames have their components separated with dashes (e.g, 'mu-log.h')
6. filenames have their components separated with dashes (e.g, 'mu-log.h'),
and start with 'mu-' where appropriate.
7. global functions have the prefix based on their module, e.g., mu-foo.h
declares a function of 'mu_foo_bar (int a);', mu-foo.c implements this.
@ -62,7 +64,7 @@
12. functions calls have a space between function name and arguments, unless
there are none, so:
foo(12, 3);
foo (12, 3);
and
@ -103,7 +105,7 @@
Anyhow, to compile straight from git:
$ git clone git://gitorious.org/mu/mu.git
$ git clone https://github.com/djcb/mu
$ cd mu
$ autoreconf -i
$ ./configure
@ -113,5 +115,3 @@
# Local Variables:
# mode: org; org-startup-folded: nil
# End: