pylint debugger

Date: January 11th 2016
Last updated: January 15th 2016

pylint is an error checking tool for python code. In short, pylint will grade your code, providing a score based on warnings and errors. For detailed documentation see http://docs.pylint.org/intro.html.

Install

# debian / ubuntu
sudo apt-get install pylint

Run at command prompt

pylint module_name
#e.g. a module I am working on...
pylint engtools

GUI option

pylint-gui

pylint screenshot

The code is omitted from this page, but a similar version is tested in operation pylint. There were several good things about my code; 1) all functions were documented,2) I don't have any bad function names, 3) I had 0 duplication, and 4) no errors or fatal warnings. The final score of 0 out of 10 is interesting! I return to this in operation pylint.

So what did pylint find; 1) two modules missing doc-strings, 2) 35 whitespace errors, 3) four lines mixing tab and space indentation, 4) four lines of code were too long, and 5) pylint has denounced my use of x as an argument name.

It seems I have some work to do reviewing PEP 0008 style guide for python code.

Back to pylint: A nice feature is that its thread-aware...

pylint -j 3 mymodule1.py mymodule2.py mymodule3.py

pylint has another interesting feature. It provides a method to compare updated versions of code. This has sent my brain off on a tangent to version control (e.g. Git... Github and Bitbucket)... re what am I missing with my current use of Git. This is a good time to jot down a few notes on using git at the command line. That's next.

results matching ""

    No results matching ""