Checking the coding style

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Feb 7 14:59:40 EST 2010


On Feb 7, 8:22 pm, Kev Dwyer <kevin.p.dw... at gmail.com> wrote:
> On Sun, 07 Feb 2010 19:36:10 +0100, Pablo Recio Quijano wrote:
> > Hi!
>
> > I'm finishing a project writen in Python, and I realize about the
> > document PEP8 - Style Guide for Python Code [1].
>
> > Is there any app or script that checks if my project pass that style
> > guide? I also worked with Drupal, and I know there is some modules and
> > scripts that checks its coding standars [2] and it's very usefull to
> > clean the code.
>
> > Thanks in advance!
>
> > [1]http://www.python.org/dev/peps/pep-0008/[2]
> >http://drupal.org/coding-standards
>
> Hello Pablo,
>
> The pep8 package (http://pypi.python.org/pypi/pep8) can do this, though
> I have never used it myself.  PyLint is a customisable static analysis
> program that checks style among other things.
>
> Cheers,
>
> Kev

I've used pep8.py myself for some Python 3.x projects, and it's pretty
good. You don't need to install it either, a simple call via python
pep8.py 'yourpythonfile.py' should do.

I think PyLint can be used for Python 2.x, but I'm not sure about 3.x.



More information about the Python-list mailing list