How to integrate Pylint with Geany so that I can use Geany as an environment for python?

http://michaeljaylissner.com/blog/using-pylint-in-geany#comments

This blog indicates the build team as

pylint -r no "%f" 

and set custom regex

 (W|E|F):([0-9]+):(.*) 

Comment suggests that with the team

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

that you can click the line number in the log and bring geany there. I tried this and it did not work for me.

In my project file, I added

 [build_settings] error_regex=^(W|E|F):([0-9]+):(.*) 

After reloading the file, the same result. Am I setting error_regex correctly? Why is this not working?

+4
source share
2 answers

I am the commentator on the blog you are quoting.

I am currently using a Debian based system (Linux Mint Debian, to be precise) and using Geany 0.20. I have a file called filetypes.python in ~/.config/geany/filedefs that contains the following:

 [build-menu] FT_00_LB=pep8 FT_00_CM=pep8 --repeat --count "%f" FT_00_WD= FT_01_LB=PyLint (basic) FT_01_CM=PYTHONPATH=${PYTHONPATH}:"%d" pylint --output-format=parseable --reports=n --errors-only "%f" FT_01_WD= FT_02_LB=PyLint (full) FT_02_CM=PYTHONPATH=${PYTHONPATH}:"%d" pylint --output-format=parseable "%f" FT_02_WD= error_regex=^([^:]+?):([0-9]+):.+ 

Please note that the key difference between my setup and the blog post is that I use --output-format=pareseable and my error_regex slightly smaller than for pylint, so it will work for pep8 .

The bit PYTHONPATH=${PYTHONPATH}:"%d" is to add the current working directory to my python user path, and it seems to me, from my point of view, it will not work like it does on Windows, therefore, if you are on Windows, of course you will need to change (or delete) this bit. In fact, if you are running on Windows, indicate that you may need a few bits that need to be changed.

+8
source

I wrote a plugin that checks your code with pep8 pylint and pyflakes, the code is available on the launch bar and is packaged for ubuntu in ppa.

https://code.launchpad.net/~oly/geany-python-code-checker/trunk

https://launchpad.net/~oly/+archive/geany

may be useful for some, you can turn some parameters on and off, and also check the length of the string.

+1
source

All Articles