This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Automatically Python checks (PEP8 and Pyflakes) when saving.

Tags: None
(comma "," separated)
realefab
Registered Member
Posts
3
Karma
0
Hello world,
I recently switched from Kate to KDevelop as my Python code editor.
The only thing I'm missing is that with Kate each time I saved my code it was highlighted with the output of Pyflakes and PEP8.
I know that having the highlight is maybe too much but I'd be happy to be notified in some way if my code is not ok.
I have already added the PEP8 and Pyflakes scripts to check the current source, but I have to call them manually and check the results in the lower shell.
Is there a way to launch them automatically and be notified if something goes wrong?

Thank you,
Fabry
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
You can't launch them on save currently, but you can enable the checker to run whenever you edit a file (see Cofigure KDevelop -> Python style checking). Does that suffice for your usecase? Let me know otherwise ;)

Greetings!


I'm working on the KDevelop IDE.
realefab
Registered Member
Posts
3
Karma
0
Thanks scummos.
I haven't configured it correctly and now the PEP8 works.
Is there anything similar for Pyflakes?

Fabrizio
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
No. We're eventually going to get some similar checks based on our own architecture, though, let's see.

Greetings!


I'm working on the KDevelop IDE.
realefab
Registered Member
Posts
3
Karma
0
PEP8 and Pyflakes have a quite similar output.
Where can I look in the source to understand the right output?
I'd like to create a single script that returns the output of both programs.

Fabrizio

PS: in the source of the PEP8 checker I have seen that the variable "pap8arguments" has a typo. I think it should be pep8arguments
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
In git://anongit.kde.org/kdev-python in pythonparsejob.cpp around line 315.

Eventually this should all be integrated into a separate, more flexible checker plugin, maybe I'll write something like that.


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]