4

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

This blog says to set build command as

 pylint -r no "%f" 

and set a custom error regex

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

The commenter suggests that with command

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

that it is possible to click on a line number in log and be brought there by geany. I tried this and it has not worked for me.

In my project file, I have added

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

After reloading the file, same result. Am I setting the error_regex correctly? Why doesnt this work?

HaltingState
  • 1,810
  • 1
  • 20
  • 22
  • @simon any idea on how I could update this to work on geany 20 on windows XP? Was trying this but might be well off the mark. PYTHONPATH=${PATH=%path%;C:\Python32}: pylint --output-format=parseable --reports=n --errors-only "%f" – sayth Jun 24 '11 at 13:41

2 Answers2

8

I'm the commenter on the blog post you cite.

I'm using a Debian-based system at the moment (Linux Mint Debian, to be precise), and using Geany 0.20. What I have is a file named filetypes.python in ~/.config/geany/filedefs which contains this:

[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]+):.+

Note that the key difference between my setup and the blog post is that i'm using --output-format=pareseable, and my error_regex is a little less pylint-specific, so that it will work for pep8 too.

The PYTHONPATH=${PYTHONPATH}:"%d" bit is to add the current working directory to my custom python path, and I guess, off the top of my head, it won't work like that on Windows, so if you're on Windows you'll certainly need to modify (or drop) that bit. In fact, if you're on Windows, please indicate that, as there might be a few bits that need changing.

simon
  • 15,344
  • 5
  • 45
  • 67
  • This worked for me. I had to add filetypes.python in the geany configuration. It wont load the configuration from anywhere else. Also, pylint does not seem to be as useful as pychecker – HaltingState May 28 '11 at 05:04
1

I have written a plugin which checks your code with pep8 pylint and pyflakes the code is available on launchpad and is packaged for ubuntu in a ppa.

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

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

maybe useful for some one, you can toggle some options on and off as well like checking of line length.

Oly
  • 370
  • 5
  • 16