[[TOC]] DeveloperGuidelines = Code Conventions = These conventions should be followed in all code. NOTE: These coding conventions are mandatory for code to be accepted for the [wiki:ucore Stable] series! == Code Style == * http://code.google.com/p/soc/wiki/PythonStyleGuide * Limit line length to 80 characters * Use " " for strings, UNLESS the string contains a ", in which case use ' == Naming conventions == * All functions outside of classes should have the prefix shn__ * All classes which over-ride existing classed should have the suffix "S3" == Comments and Docstrings == * All files, classes and functions should have docstrings which allow to auto-generate API documentation using [http://epydoc.sourceforge.net epydoc] == Internationalisation == * All user-visible strings should be Internationalised: {{{T("My string")}}} * Remember to {{{str()}}} them before concatenating with strings (such as HTML tags): {{{"

" + str(T("My String")) + "

"}}} * All labels should be Internationalised in {{{controllers/module.py def resource()}}}: {{{table.field.label = T("My Label")}}} * DeveloperGuidelinesInternationalisation == Tools == * Some automated bug analysis / code quality checking tools - * [http://www.logilab.org/857 PyLint] * gives detailed report * code quality score tells exact impact of the changes made * http://www.logilab.org/card/pylint_tutorial * [http://pychecker.sourceforge.net/ PyChecker] recommended in [http://code.google.com/p/soc/wiki/PythonStyleGuide PythonStyleGuide] ---- DeveloperGuidelines