[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: static analysis and other tools for checking Python code



On 2016-03-02 11:22:52 +0800 (+0800), Paul Wise wrote:
[...]
> One of the things it has checks for is Python. So far it runs pyflakes
> and pep8 and a few hacky greps for some things that shouldn't be done
> in Python in my experience.
[...]

The "flake8" framework basically incorporates the pyflakes and pep8
analyzers along with a code complexity checker, and provides a
useful mechanism for controlling their behavior in a consistent
manner as well as pluggability to add your own:

    https://packages.debian.org/flake8

One flake8 plug-in which came out of the OpenStack developer
community is "hacking" (obviously not for every project, but an
interesting reference example of layering in your own style checks):

    https://packages.debian.org/python-hacking

Another output of the OpenStack community is "bandit," a security
analyzer for Python code:

    https://packages.debian.org/bandit

Some other interesting analyzers not yet packaged for Debian as far
as I can tell include "pep257" (a Python docstring checker) and
"clonedigger" (a DRYness checker).

    https://pypi.python.org/pypi/pep257
    https://pypi.python.org/pypi/clonedigger

I can probably think up more that I've used, but the above rise to
the top of my list.
-- 
Jeremy Stanley


Reply to: