[Qgis-developer] Python coding style for QGIS
lists at linfiniti.com
Tue May 1 03:15:58 EDT 2012
On Tue, May 1, 2012 at 7:42 AM, Alexander Bruy <alexander.bruy at gmail.com> wrote:
> Hi all,
> we already have coding style for QGIS C++ code . But in QGIS core
> there are also several Python plugins which have a different coding style.
> I think we need to create coding style for Python code included in master
> and reformat existing code to comply with this style.
> There is a PEP-0008 , an official Python style guide, not sure if we
> should use it as is. Maybe it is better to adopt it a bit and make more
> consistent with our C++ coding style.
>  https://github.com/qgis/Quantum-GIS/blob/master/CODING
>  http://www.python.org/dev/peps/pep-0008/
I would suggest that we use PEP8 - many editors will parse this and
there are checking tools that can be run from the command line. I
would also suggest we use 4 space indents so we can process code using
pyindent. I know it isnt very consistent with QGIS C++ coding standard
but many python coders are used to these standards and they are easy
to check and enforce.
I think it would be great to extend our CODING doc to include python
guidelines. I have already worked on similar guidelines for another
project  which we could easily adapt.
> Alexander Bruy
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
Tim Sutton - QGIS Project Steering Committee Member (Release Manager)
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.
Visit http://linfiniti.com to find out about:
* QGIS programming and support services
* Mapserver and PostGIS based hosting plans
* FOSS Consulting Services
Irc: timlinux on #qgis at freenode.net
More information about the Qgis-developer