Skip to content

Commit

Permalink
Merge branch 'symbol-style' of git://github.com/djmitche/buildbot
Browse files Browse the repository at this point in the history
  • Loading branch information
djmitche committed Aug 10, 2013
2 parents d6bf757 + 2753fc4 commit 5584042
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions master/docs/developer/style.rst
Expand Up @@ -4,15 +4,26 @@ Buildbot Coding Style
Symbol Names
------------

Buildbot follows `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_ regarding
the formatting of symbol names.

The single exception in naming of functions and methods. Because Buildbot uses
Twisted so heavily, and Twisted uses interCaps, Buildbot methods should do the
same. That is, you should spell methods and functions with the first character
in lower-case, and the first letter of subsequent words capitalized, e.g.,
``compareToOther`` or ``getChangesGreaterThan``. This point is not applied very
consistently in Buildbot, but let's try to be consistent in new code.
Buildbot follows `PEP8 <http://www.python.org/dev/peps/pep-0008/>`_ regarding the formatting of symbol names.
Because Buildbot uses Twisted so heavily, and Twisted uses interCaps, this is not very consistently applied throughout the codebase.

The single exception to PEP8 is in naming of functions and methods.
That is, you should spell methods and functions with the first character in lower-case, and the first letter of subsequent words capitalized, e.g., ``compareToOther`` or ``getChangesGreaterThan``.

Symbols used as parameters to functions used in configuration files should use underscores.

In summary, then:

================== ============
Symbol Type Format
================== ============
Methods interCaps
Functions interCaps
Function Arguments under_scores
Classes InitialCaps
Variables under_scores
Constants ALL_CAPS
================== ============

Twisted Idioms
--------------
Expand Down

0 comments on commit 5584042

Please sign in to comment.