You are not logged in.

#1 2017-01-07 13:34:10

whoops
Member
Registered: 2009-03-19
Posts: 891

[solved] Kdevelop Python style checking (pep8 / flake8)

I can't tell if this is supposed to be used with a different pep8 checker that isn't in the repos or if I'm using it wrong:

The selected PEP8 syntax checker "/usr/bin/flake8" does not seem to work correctly.

flake8 appears to work fine when I run it in a terminal. I have not been able to find out what output format kdevelop expects... or what output format pep8 should offer... or anything much. Either I'm looking in all the wrong places or the documentations for all those things are terrible.

So I ended up reading code I barely understand (again) T_T:

static QRegularExpression errorFormat("(.*):(\\d*):(\\d*): (.*)", QRegularExpression::CaseInsensitiveOption);

in https://github.com/KDE/kdev-python/blob … ng.cpp#L95
suggests, that the output format of flake8... probably... should be ok, because this look like a match?

./test.py:3:1: F401 'sys' imported but unused

( Also I made sure that QT_LOGGING_RULES environment variable is unset, but I don't remember why I thought that might help. It didn't. )


Any hints?

Last edited by whoops (2017-01-14 13:28:54)

Offline

#2 2017-01-10 18:57:28

qi437103
Member
Registered: 2014-09-21
Posts: 3
Website

Re: [solved] Kdevelop Python style checking (pep8 / flake8)

I think you'd better ask on IRC #kdevelop or the mailing list https://mail.kde.org/mailman/listinfo/kdevelop-devel.

Offline

#3 2017-01-14 13:28:38

whoops
Member
Registered: 2009-03-19
Posts: 891

Re: [solved] Kdevelop Python style checking (pep8 / flake8)

Finally got it to work by creating this as a bash script and having kdevelop use it instead of flake8 directly:

python -I /usr/bin/flake8 --exit-zero $@

Have not been able to identify the environment setting(?) that is responsible for the problem.

Offline

Board footer

Powered by FluxBB