Changes between Version 8 and Version 9 of Contributing/CodingStyle


Ignore:
Timestamp:
02/10/2014 07:01:12 PM (10 years ago)
Author:
Cas
Comment:

Add info about gtk unicode, some refs and commit message details

Legend:

Unmodified
Added
Removed
Modified
  • Contributing/CodingStyle

    v8 v9  
    22 
    33== Common == 
    4  * Max line length 119 rather than 79 but ideally keep to 79 
     4 * Max line length `119` rather than usual `79`. That said, where possible keep to `79`. 
    55 
    66== Python == 
    77Mostly follow [http://www.python.org/dev/peps/pep-0008/ PEP8] with the following exceptions: 
    8  * Line length (see above) 
     8 * Line length ''(see above)'' 
    99 
    1010 * Code should pass the [https://pypi.python.org/pypi/flake8 flake8] source code checker and in ideal cases [http://www.pylint.org/ Pylint] too.   
    1111 
    12  * All byte arrays (byte strings) should be decoded to strings (unicode strings) on input and encoded back to byte arrays on output. [http://stackoverflow.com/a/606199/175584 From Stackoverflow:] 
     12 * All byte arrays (byte strings, `str`) should be decoded to strings (unicode strings, `unicode`) on input and encoded back to byte arrays on output. [http://stackoverflow.com/a/606199/175584 From Stackoverflow:] 
    1313{{{ 
    1414>>> b"abcde" 
     
    1818}}} 
    1919 
     20 **Note:** PyGTK/GTK+ will accept `str` (utf8 encoded) or `unicode` but will only return `str`. See [http://python-gtk-3-tutorial.readthedocs.org/en/latest/unicode.html GTK+ Unicode] docs.  
     21 
    2022 * All path separators used within code should be converted to posix format `/`, so should not contain `\` or `\\`. This is to prevent confusion when dealing with cross-platform clients and servers. 
     23 
     24=== Python References === 
     25 
     26Useful links to style guides from other projects: 
     27 
     28 * [http://docs.ckan.org/en/latest/contributing/python.html CKAN Python coding standards] 
     29 * [http://google-styleguide.googlecode.com/svn/trunk/pyguide.html Google Python Style Guide] 
    2130 
    2231== Javascript == 
     
    2534 * Class names should be in !CamelCase 
    2635 * Instances of classes should use camelCase. 
     36 
     37== Commit Messages ==  
     38{{{ 
     39#!comment 
     40This should probably have it's own page but putting here for now. 
     41}}} 
     42 Mainly based on [http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines git commit guidelines]  
     43 
     44 * If the commit fix/closes a ticket, include the number: 
     45 
     46 {{{[#1001] Add support for magnet uris}}} 
     47 
     48 To differentiate commit changes at a glance, commits for specific components can optionally include tags.  
     49 e.g. ''WebUI'', ''GTKUI'', ''Console'', ''Blocklist'' etc. 
     50 
     51 {{{[#1002] [GTKUI] Fix the files tab context menu not being displayed}}} 
     52