]> arthur.barton.de Git - bup.git/blob - CODINGSTYLE
Drop support for python 2
[bup.git] / CODINGSTYLE
1 .. -*-rst-*-
2
3 C
4 =
5
6 The C implementations should follow the `kernel/git coding style
7 <http://www.kernel.org/doc/Documentation/CodingStyle>`_.
8
9
10 Python
11 ======
12
13 Python code follows `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_
14 with regard to coding style and `PEP257
15 <http://www.python.org/dev/peps/pep-0257/>`_ with regard to docstring
16 style. Multi-line docstrings should have one short summary line,
17 followed by a blank line and a series of paragraphs. The last
18 paragraph should be followed by a line that closes the docstring (no
19 blank line in between). Here's an example from
20 ``lib/bup/helpers.py``::
21
22   def unlink(f):
23       """Delete a file at path 'f' if it currently exists.
24
25       Unlike os.unlink(), does not throw an exception if the file didn't already
26       exist.
27       """
28       ...
29
30 Module-level docstrings follow exactly the same guidelines but without the
31 blank line between the summary and the details.