From bcde9c0aa535eff71dab9101a30956a17ab5b1fb Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 3 Jul 2013 23:24:19 +0200 Subject: [PATCH] doc: add a CONTRIBUTE document --- CONTRIBUTE.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 2 +- 2 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTE.md diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md new file mode 100644 index 00000000..123537e4 --- /dev/null +++ b/CONTRIBUTE.md @@ -0,0 +1,66 @@ +Coding standards +---------------- + +Contributed code should roughly follow [OpenBSD style][1]. For Emacs, +I am using the following snippet to get the appropriate indentation: + + (c-add-style + "openbsd" + '("bsd" + (c-basic-offset . 8) + (c-tab-width . 8) + (fill-column . 80) + (indent-tabs-mode . t) + (c-offsets-alist . ((defun-block-intro . +) + (statement-block-intro . +) + (statement-case-intro . +) + (statement-cont . *) + (substatement-open . *) + (substatement . +) + (arglist-cont-nonempty . *) + (inclass . +) + (inextern-lang . 0) + (knr-argdecl-intro . +))))) + +Important stuff is to use tabulations. Each tabulation has a width of +8 characters. This limits excessive nesting. Try to respect the 80 +columns limit if possible. + +Opening braces are on the same line, except for functions where they +are on their own lines. Closing braces are always on their own +lives. Return type for functions are on their own lines too: + + int + main(int argc, char *argv[]) + { + /* [...] */ + } + +[1]: http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 + +Submitting patches +------------------ + +Patches against git tip are preferred. Please, clone the repository: + + git clone https://github.com/vincentbernat/lldpd.git + +Do any modification you need. Commit the modifications with a +meaningful message: + + 1. Use a descriptive first-line. + + 2. Prepend the first line with the name of the subsystem modified + (`lldpd`, `lib`, `client`) or something a bit more precise. + + 3. Don't be afraid to put a lot of details in the commit message. + +Use `git format-patch` to get patches to submit: + + git format-patch origin/master + +Feel free to use `git send-email` which is like `git format-patch` but +will propose to directly send patches by email. You can also open a +[pull request][2] on Github. + +[2]: https://help.github.com/articles/using-pull-requests diff --git a/Makefile.am b/Makefile.am index fde6c029..273a4dc5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,7 +7,7 @@ EXTRA_DIST = $(DX_CONFIG) include get-version autogen.sh DIST_SUBDIRS = $(SUBDIRS) libevent DISTCLEANFILES = ChangeLog -dist_doc_DATA = README.md NEWS +dist_doc_DATA = README.md NEWS CONTRIBUTE.md doc_DATA = ChangeLog __force-changelog-generation: -- 2.39.5