Re: static analysis and other tools for checking Python code

2016-03-03 Thread Paul Wise
On Thu, 2016-03-03 at 12:52 +0100, Nicolas Chauvat wrote:


> That would be https://pypi.python.org/pypi/PyChecker
> 
> Pylint has never run code from the source tree.

I wonder where I got that impression from.

What about from the module it is checking?

> "pylint " should work fine.

Unfortunately that needs the module installed to work.

Is there any way to make it scan the source tree instead?

-- 
bye,
pabs

https://wiki.debian.org/PaulWise




signature.asc
Description: This is a digitally signed message part


Re: static analysis and other tools for checking Python code

2016-03-03 Thread Nicolas Chauvat

/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 " should work fine.

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

One option is to run "pylint -E " 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=q=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