/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/developers/code-style.txt

  • Committer: Jelmer Vernooij
  • Date: 2018-02-18 21:42:57 UTC
  • mto: This revision was merged to the branch mainline in revision 6859.
  • Revision ID: jelmer@jelmer.uk-20180218214257-jpevutp1wa30tz3v
Update TODO to reference Breezy, not Bazaar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
***********************
2
 
Breezy Code Style Guide
 
2
Bazaar Code Style Guide
3
3
***********************
4
4
 
5
5
Code layout
77
77
Python versions
78
78
===============
79
79
 
80
 
Breezy supports Python 2.7 and Python 3.5 or later.
 
80
Bazaar supports Python from 2.6 through 2.7, and in the future we want to
 
81
support Python 3.  Avoid using language features added in
 
82
2.7, or features deprecated in Python 3.0.  (You can check v3
 
83
compatibility using the ``-3`` option of Python2.6.)
 
84
 
81
85
 
82
86
hasattr and getattr
83
87
===================
189
193
   being leaked); merely having a del method inhibits Python gc; the
190
194
   warnings appear to users and upset them; they can also break tests that
191
195
   are checking what appears on stderr.
192
 
 
 
196
  
193
197
In short, just don't use ``__del__``.
194
198
 
195
199
Cleanup methods
235
239
Registries
236
240
==========
237
241
 
238
 
Several places in Breezy use (or will use) a registry, which is a
 
242
Several places in Bazaar use (or will use) a registry, which is a
239
243
mapping from names to objects or classes.  The registry allows for
240
244
loading in registered code only when it's needed, and keeping
241
245
associated information such as a help string or description.
391
395
Test coverage
392
396
=============
393
397
 
394
 
All code should be exercised by the test suite.  See the `Breezy Testing
395
 
Guide <http://www.breezy-vcs.org/developers/testing.html>`_ for detailed
 
398
All code should be exercised by the test suite.  See the `Bazaar Testing
 
399
Guide <http://doc.bazaar.canonical.com/developers/testing.html>`_ for detailed
396
400
information about writing tests.
397
401
 
398
402
 
405
409
 
406
410
Rationale:
407
411
 
408
 
* It makes the behaviour vary depending on whether brz is run with -O
 
412
* It makes the behaviour vary depending on whether bzr is run with -O
409
413
  or not, therefore giving a chance for bugs that occur in one case or
410
414
  the other, several of which have already occurred: assertions with
411
415
  side effects, code which can't continue unless the assertion passes,