]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
doc: add a CONTRIBUTE document
authorVincent Bernat <bernat@luffy.cx>
Wed, 3 Jul 2013 21:24:19 +0000 (23:24 +0200)
committerVincent Bernat <bernat@luffy.cx>
Wed, 3 Jul 2013 21:24:19 +0000 (23:24 +0200)
CONTRIBUTE.md [new file with mode: 0644]
Makefile.am

diff --git a/CONTRIBUTE.md b/CONTRIBUTE.md
new file mode 100644 (file)
index 0000000..123537e
--- /dev/null
@@ -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
index fde6c0296bc0f57057b83a7fd44463eb8f2a021b..273a4dc5348a3063fd177b59392b1db60750faac 100644 (file)
@@ -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: