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

Re: static analysis and other tools for checking Python code



/Disclaimer: I started pylint with Sylvain Thénault back in 2001, but
the project has had new maintainers for a few years./

On Thu, Mar 03, 2016 at 08:06:52AM +0800, Paul Wise wrote:
> On Wed, Mar 2, 2016 at 9:23 PM, Nicolas Chauvat wrote:
> 
> > Maybe add pylint?
> 
> As I understand it:
> 
> pylint runs code from the source tree so it isn't suitable for running
> by default as that could be a security issue for people reviewing
> potentially untrusted code.

That would be https://pypi.python.org/pypi/PyChecker

Pylint has never run code from the source tree.

> pylint isn't able to be run automatically, it needs a human to come up
> with the right command-line.

"pylint <themodule>" should work fine.

Tuning pylint to a specific coding or project requires human action.

One option is to run "pylint -E <themodule>" to look only for
errors. This is also faster.

> [Paul Tagliamonte] flake8 has the most mindshare

That's not what google trends says

  https://www.google.fr/trends/explore#q=flake8%2C%20pylint%2C%20pyflakes&cmpt=q&tz=Etc%2FGMT-1

I included pyflakes because flake8's doc says "Flake8 is a wrapper around
PyFlakes, pep8 and Ned Batchelder’s McCabe script".
	    
The "Design Principles" section from pyflakes' doc states:

  """Pyflakes is also faster than Pylint or Pychecker. This is largely
  because Pyflakes only examines the syntax tree of each file
  individually. As a consequence, Pyflakes is more limited in the types
  of things it can check."""

To get the list of all the things your installed version of pylint can check for:

  pylint --list-msgs
  
Github stats prove the pylint project is pretty active

  https://github.com/PyCQA/pylint/graphs/contributors

-- 
Nicolas Chauvat

logilab.fr - services en informatique scientifique et gestion de connaissances  


Reply to: