Rev 2796: Document code layout stuff in http://sourcefrog.net/bzr/doc
mbp at sourcefrog.net
Wed Sep 5 06:12:22 BST 2007
revision-id: mbp at sourcefrog.net-20070905051221-ubcur9dfodsozr28
parent: pqm at pqm.ubuntu.com-20070905001648-0iigag4tq1u8mywn
committer: Martin Pool <mbp at sourcefrog.net>
branch nick: doc
timestamp: Wed 2007-09-05 15:12:21 +1000
Document code layout stuff
=== modified file 'doc/developers/HACKING.txt'
--- a/doc/developers/HACKING.txt 2007-08-28 06:59:20 +0000
+++ b/doc/developers/HACKING.txt 2007-09-05 05:12:21 +0000
@@ -624,12 +624,64 @@
Coding Style Guidelines
Please write PEP-8__ compliant code.
One often-missed requirement is that the first line of docstrings
should be a self-contained one-sentence summary.
+We use 4 space indents for blocks, and never use tab characters. (In vim,
+Lines should be no more than 79 characters if at all possible.
+Lines that continue a long statement may be indented in either of
+within the parenthesis or other character that opens the block, e.g.::
+or indented by four spaces::
+The first is considered clearer by some people; however it can be a bit
+harder to maintain (e.g. when the method name changes), and it does not
+work well if the relevant parenthesis is already far to the right. Avoid
+but rather ::
+ one, two, three)
+For long lists, we like to add a trailing comma and put the closing
+character on the following line. This makes it easier to add new items in
+ from bzrlib.goo import (
More information about the bazaar-commits