Home Download Buy Blog Forum Support

SublimeLint (Realtime lint highlighting)

Re: SublimeFlakes (Inline realtime Python lint)

Postby vostok4 on Sun Feb 20, 2011 7:58 am

And I just learned how to use hg-git and github, so you have a pull request on github. cool stuff.
vostok4
 
Posts: 25
Joined: Fri Oct 22, 2010 6:09 pm

Re: SublimeFlakes (Inline realtime Python lint)

Postby theblacklion on Sun Feb 20, 2011 11:18 pm

Lunixbochs, it would be great if you could bring in support for PHP. Some guys at my company are currently switching to sublime and this would give them another kick :).
theblacklion
 
Posts: 67
Joined: Sat Feb 05, 2011 10:07 pm
Location: Hannover, Germany

Re: SublimeFlakes (Inline realtime Python lint)

Postby lunixbochs on Sun Feb 20, 2011 11:56 pm

will probably have autoloading and my own php plugin in the repo tonight if I don't get distracted :)

edit: both done, along with more updates (coolest new thing is for development: language submodules will automatically reload like normal sublime modules when you save them in st)
Last edited by lunixbochs on Mon Feb 21, 2011 6:30 am, edited 2 times in total.
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: SublimeFlakes (Inline realtime Python lint)

Postby aroberge on Mon Feb 21, 2011 2:00 am

lunixbochs: I tried to send you a private email but got an error from the server.

I've started working on an "improved" version which can be found at http://code.google.com/p/py-fun/source/ ... _plugin.py
Right now, I've focused on refactoring and trying to make it a bit more readable (hopefully!), eliminating some dead code and unneeded declaration (like all the global statements).

Eventually, I'd like to add the possibility to run pylint (instead of pyflakes) and/or pep8, as well as jslint and others...

Anyone can feel free to use any or all or none of the little I did (so far).

André
andre (dot) roberge (at) gmail (dot) com
aroberge
 
Posts: 21
Joined: Sat Feb 12, 2011 1:03 am

Re: SublimeFlakes (Inline realtime lint highlighting)

Postby aroberge on Wed Feb 23, 2011 12:56 am

For those interested, I have created a fork of Ryan's excellent plugin. You can find my version at https://github.com/aroberge/sublimelint . I have not changed the readme file nor added any copyright information. I expect Ryan to implement some/all of the new functionality that I have added eventually. I reorganized the code significantly and changed quite a few names so that *I* could find it easier to read and understand; your mileage may vary.

The main addition, as compared with Ryan's version is that one can use pylint - but not in realtime. pylint is quite slow, and I have it setup so that it is run on demand. NOTE that you need to have pylint already installed - unlike pyflakes which comes included with the plugin.

Some small differences:
1. to enable the plugin to work by default, you need to set a user preference "sublime_linter" to true.
2. you can turn on/off the linter via a command view.run_command("linter_on") (or "linter_off") - even if you have not set a user preference before.
3. To run a linter "once" (i.e. not always on in the background), you use
view.run_command("run_linter", "linter") where "linter" is one of "Python", "PHP" or "pylint"
4. If you run a linter via a command as in 3. above, the realtime linter is disabled. To reset it to its previous state (on or off...) AND to clear all visible "errors" you use the command
view.run_command("reset_linter")

For some reason, the configuration file for pylint is not read in ... I tried various options but could not get it to work. I've turned off a couple of things but you may find that pylint reports too many errors to your liking ... I'll try to improve upon it - but suggestions/patches are most welcome.

Also, I found that I simply could not use the subprocess approach used for the php linter (it could not find "pylint" ...) and had to resort to importing the pylint module itself. Unfortunately, this means that if you want to work on the pylint plugin itself, you may have to quit Sublime Text and restart to see changes take place (unlike the situation for the other plugins, thanks to some very nice code originally written by Ryan).
aroberge
 
Posts: 21
Joined: Sat Feb 12, 2011 1:03 am

Re: SublimeLint (Realtime lint highlighting)

Postby samkerr on Thu Jul 14, 2011 6:16 pm

I don't always install plugins, but when I do, they're awesome like yours.

Great job.
samkerr
 
Posts: 51
Joined: Mon Aug 03, 2009 11:20 pm

Re: SublimeLint (Realtime lint highlighting)

Postby Kronuz on Fri Jul 15, 2011 9:55 pm

If you're looking for PEP 8 highlighting, check my fork at http://github.com/Kronuz/SublimeLint It also improves a few things such as improved (less aggressive, CPU-wise) real time highlighting.
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: SublimeLint (Realtime lint highlighting)

Postby lunixbochs on Thu Jul 28, 2011 2:44 pm

sublimator wrote:You thought about doing any node selection commands using the ast?
like "goto symbol"?
I'm waiting to do anything really fancy with the python module till I finish switching to my own ast implementation: https://github.com/lunixbochs/sublimeli ... /python.py
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: SublimeLint (Realtime lint highlighting)

Postby aparajita on Thu Jul 28, 2011 4:07 pm

Kronuz wrote:If you're looking for PEP 8 highlighting, check my fork at http://github.com/Kronuz/SublimeLint It also improves a few things such as improved (less aggressive, CPU-wise) real time highlighting.


I tried it, but it is not doing real time linting of python. I have pylint and pep8 installed. What am I missing?

When I run it from the console, I get the following error:

Code: Select all
  File "./sublimelint/modules/sublime_pylint.py", line 84, in run
ValueError: invalid literal for int() with base 10: '53,0'
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm

Re: SublimeLint (Realtime lint highlighting)

Postby Kronuz on Thu Jul 28, 2011 4:54 pm

@aparajita, instead of pylint, I use pyflakes and the pep8, in the python.py module. The error you're getting probably comes from a misconfigured pylint (called by sublime_pylint.py)... you can try disabling pylint (and/or deleting the pylint command)
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 8 guests