]> git.ipfire.org Git - thirdparty/lldpd.git/blame - CONTRIBUTE.md
Merge pull request #391 from Polynomial-C/1.0.5-gentoo_seccomp
[thirdparty/lldpd.git] / CONTRIBUTE.md
CommitLineData
bcde9c0a
VB
1Coding standards
2----------------
3
4Contributed code should roughly follow [OpenBSD style][1]. For Emacs,
5I am using the following snippet to get the appropriate indentation:
6
7 (c-add-style
8 "openbsd"
9 '("bsd"
10 (c-basic-offset . 8)
11 (c-tab-width . 8)
12 (fill-column . 80)
13 (indent-tabs-mode . t)
14 (c-offsets-alist . ((defun-block-intro . +)
15 (statement-block-intro . +)
16 (statement-case-intro . +)
17 (statement-cont . *)
18 (substatement-open . *)
19 (substatement . +)
20 (arglist-cont-nonempty . *)
21 (inclass . +)
22 (inextern-lang . 0)
23 (knr-argdecl-intro . +)))))
24
25Important stuff is to use tabulations. Each tabulation has a width of
268 characters. This limits excessive nesting. Try to respect the 80
27columns limit if possible.
28
29Opening braces are on the same line, except for functions where they
30are on their own lines. Closing braces are always on their own
31lives. Return type for functions are on their own lines too:
32
33 int
34 main(int argc, char *argv[])
35 {
36 /* [...] */
37 }
38
39[1]: http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9
40
41Submitting patches
42------------------
43
44Patches against git tip are preferred. Please, clone the repository:
45
46 git clone https://github.com/vincentbernat/lldpd.git
47
48Do any modification you need. Commit the modifications with a
49meaningful message:
50
51 1. Use a descriptive first-line.
52
53 2. Prepend the first line with the name of the subsystem modified
54 (`lldpd`, `lib`, `client`) or something a bit more precise.
55
56 3. Don't be afraid to put a lot of details in the commit message.
57
58Use `git format-patch` to get patches to submit:
59
60 git format-patch origin/master
61
62Feel free to use `git send-email` which is like `git format-patch` but
63will propose to directly send patches by email. You can also open a
64[pull request][2] on Github.
65
66[2]: https://help.github.com/articles/using-pull-requests