]> arthur.barton.de Git - bup.git/commitdiff
Add a coding style document.
authorGabriel Filion <lelutin@gmail.com>
Mon, 11 Oct 2010 18:41:26 +0000 (14:41 -0400)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Nov 2010 05:13:01 +0000 (21:13 -0800)
The document is largely inspired by the one in Scott Chacon's "HACKING"
file [1] in his 'agitmemnon-server' repository on GitHub with some
precision on the docstring style that was adopted for bup.

http://github.com/schacon/agitmemnon-server/blob/master/HACKING

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
CODINGSTYLE [new file with mode: 0644]

diff --git a/CODINGSTYLE b/CODINGSTYLE
new file mode 100644 (file)
index 0000000..e28df2f
--- /dev/null
@@ -0,0 +1,24 @@
+Python code follows PEP8 [1] with regard to coding style and PEP257 [2] with
+regard to docstring style. Multi-line docstrings should have one short summary
+line, followed by a blank line and a series of paragraphs. The last paragraph
+should be followed by a line that closes the docstring (no blank line in
+between). Here's an example from lib/bup/helpers.py:
+
+def unlink(f):
+    """Delete a file at path 'f' if it currently exists.
+
+    Unlike os.unlink(), does not throw an exception if the file didn't already
+    exist.
+    """
+    #code...
+
+Module-level docstrings follow exactly the same guidelines but without the
+blank line between the summary and the details.
+
+
+The C implementations should follow the kernel/git coding style [3].
+
+
+[1]:http://www.python.org/dev/peps/pep-0008/
+[2]:http://www.python.org/dev/peps/pep-0257/
+[3]:http://www.kernel.org/doc/Documentation/CodingStyle