2013/11/11 Philipp A. <flying-sheep@web.de>
2013/11/11 Sven Brauch <svenbrauch@googlemail.com>
Why not just run those utilities as provided by the system? There's pep8-
python2 and pep8-python3, so you can just execute those programs and have both
language versions supported, no?

Or does kate currently invoke them using libpython too? In that case this
should maybe be changed.

Sven

the tool is written using python and has a python api, so it’s pretty natural to just use that instead of letting the tool create python datastructures, convert them to text, write that text to a pipe, read that text from the pipe, and parse it into python datastructures again.

but i agree: if pep8.py can’t be fixed to work on scripts written in the version of python that it isn’t run with, we should do that. for the sake of elegance, however, we should only use that backwards way for the other version (i.e. use the python api to use pep8.py on python 3 files, and use a shell to run python2 pep8.py and parse the output on python2 files)


Thanks for the explication. 
 
PS: we have quite a bunch of linters now. i think it’s time to generate a common linter base class that can be subclassed. like:
  1. BaseLinter (base class for all linters with methods to run it and show line highlights and a method that runs it and returns a list of errors)
  2. ConsoleLinter (where you have to pass a console command and if it can use stdin or has to use a tmpfile, as well as have to override a method to parse its output to a list of errors)
  3. JSLinter (uses my new JS framework that currently lives in jsutils to load a JS module and pass the lintable source through it)

i’ll be glad to write it once my changes to jsutils get pulled and we got rid of kate.gui in favor of a better alternative.


_______________________________________________
KWrite-Devel mailing list
KWrite-Devel@kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel