Coding standards » History » Version 8
laforge, 02/21/2016 02:06 PM
1 | 8 | laforge | h1. Osmocom coding standards |
---|---|---|---|
2 | 1 | ||
3 | 8 | laforge | h1. Coding Style |
4 | |||
5 | In general, for the C-language projects we maintain in the Osmocom project, we follow the coding style |
||
6 | of the Linux kenrel. See https://www.kernel.org/doc/Documentation/CodingStyle for further information. |
||
7 | |||
8 | We will not debate about the coding style and whether some other style is better or worse. The important factor is not so much _which_ coding style is followed, as long as there is one well-defined coding style and that all developers adhere to it. |
||
9 | |||
10 | h2. Submitting Patches |
||
11 | |||
12 | For submitting patches, the best practises established by the Linux kernel development community should be followed, whenever applicable. See https://www.kernel.org/doc/Documentation/SubmittingPatches for further information. |
||
13 | |||
14 | The generally important topics are: |
||
15 | |||
16 | h3. Submit patches against a current source tree |
||
17 | |||
18 | At time of submission, our patches should be based on current @master@ branch of the respective project, or another (more current) feature branch of that repository. |
||
19 | |||
20 | h3. Use unified diff format |
||
21 | |||
22 | It's best to let git generate the patches, so you don't have to worry about that. |
||
23 | |||
24 | h3. Have meaningful descriptions in your patches |
||
25 | |||
26 | Every commit/patch should have an explanation in the commit message. |
||
27 | |||
28 | h3. Separate your changes |
||
29 | |||
30 | Separate each _logical change_ into a separate patch. |
||
31 | |||
32 | h3. Respond to review comments |
||
33 | |||
34 | h3. Include PATCH in the subject |
||
35 | |||
36 | |||
37 | h2. Rules of thumb |
||
38 | |||
39 | Some general rules of thumb: |
||
40 | * Consider using tools like @Lindent@ and @checkpatch.pl@ or @universalindentgui@ before submitting code |
||
41 | * Run @make@, @make check@ and @make distcheck@ on each of your commits to ensure the build |
||
42 | * Use @git send-email@ or @git imap-send@ to send your patches (otherwise your mail client may wrap around lines and corrupt your patch) |