MW

Kate linter plugin

Just a quicky: I wrote a little plugin for KTextEditor which supplies you with basic error checking when you save documents. Currently only PHP (via php -l) and JavaScript (via JavaScript Lint) are supported.

Screenshots

Requirements

Installing

Get the sources for the linter plugin from KDE SVN and compile it, using e.g. the functions supplied via the .bashrc mentioned above:

     # go to your development folder
    cs
    # checkout sources
    svn co svn://anonsvn.kde.org/home/kde/trunk/playground/devtools/kte_linter
    cd kte_linter
    # build base linter plugin
    cd linter
    cmakekde
    # build php linter plugin
    cd ../phplinter
    cmakekde
    # build javascript linter plugin
    cd ../jslinter
    cmakekde
    # update sycoca
    kbuildsycoca4
    # start editor and select the plugins - happy coding!
    kwrite

Todo

If you know good linters drop me a note. But it would be even better if you could write your own linter plugin. It’s pretty easy, take a look at one of the existing plugins for a skeleton & documentation.

Happy coding!

Comments

Want to comment? Send me an email!

Comment by David Anderson (not verified) (2012-10-22 13:26:00)

Hi,

Just what I was looking for, if I could get it to work…

1) If I start up a session with PHP documents open, then it shows an error “exitCode 0, exitStatus 1” for every PHP document (whether it has errors or not)

2) It correctly detects whether a file has an error or not, but the window it opens to show the error is always empty. (i.e. If the file is good, then nothing happens upon saving - but if the file is bad then it throws up a window which has nothing inside it).

This is with KDE 4.8.5 on Fedora 16.

Comment by Medifast (not verified) (2009-09-28 15:19:00)

That is very cool!