Using Pylint in Geany


Pylint is a tool that tells you when your Python code is broken or when it has coding problems. As a newish Python coder, using it has taught me a lot about conventions, and has helped to make my code significantly cleaner. Enabling it in my IDE, Geany, makes it so that using it is just another part of my development workflow.

Enabling Pylint in Geany is easy. Simply open Geany, and create a new build command that uses pylint -r no "%f" as the command, and (W|E|F):([0-9]+):(.*) as the error regular expression. After you've done this, using this build command instead of saving your work will run Pylint on your current file, showing you warnings, errors and fatal errors in red.

If you change the command to
PYTHONPATH=${PYTHONPATH}:$(dirname %d) pylint --output-format=parseable --reports=n "%f"

and use the same regex, not only do you not have to worry about spaces before the line number, but Geany will know which line the errors are on. You can click in the compiler tab to jump to the line, and the lines will be highlighted with a jagged underline :)

if you use a regex like ^(.+?):([0-9]+):.+ it will also serve for, e.g., pep8 --repeat --count "%f"

Simon, I tried your regular expression by putting the following in my project file in Geany;


This still did not allow me to zoom to the lines on which errors occurred. I tried both

PYTHONPATH=${PYTHONPATH}:$(dirname %d) pylint --output-format=parseable --reports=n "%f"


pylint -r no "%f"

What exactly do I have to do to get this working?

I also created a stackoverflow question about this