Home Download Buy Blog Forum Support

SublimeLint (Realtime lint highlighting)

Re: SublimeLint (Realtime lint highlighting)

Postby Kronuz on Fri Aug 05, 2011 7:50 pm

@andymccurdy, You should use User File Settings to put the SublimeLint settings. What settings aren't working?
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: SublimeLint (Realtime lint highlighting)

Postby rdougan on Fri Aug 05, 2011 7:52 pm

@andymccurdy Also, make sure there are no errors in the console. Has happened a few times for me
rdougan
 
Posts: 44
Joined: Sat Apr 09, 2011 2:37 am

Re: SublimeLint (Realtime lint highlighting)

Postby Kronuz on Fri Aug 05, 2011 8:01 pm

@andymccurdy, the setting you have to add to the User File Settings is something like this, to ignore pep8 errors (David Cramer told me you were asking him):

Code: Select all
"pep8_ignore": [ "E501" ],
Kronuz
 
Posts: 98
Joined: Mon Feb 14, 2011 3:14 pm

Re: SublimeLint (Realtime lint highlighting)

Postby andymccurdy on Fri Aug 05, 2011 9:13 pm

@Kronuz Ah, I was putting in in User Global Settings. Thanks!
andymccurdy
 
Posts: 9
Joined: Sat Jan 29, 2011 2:14 am

Re: SublimeLint (Realtime lint highlighting)

Postby aparajita on Fri Aug 05, 2011 10:57 pm

rdougan wrote:Linting used to work when you simply modified the file, but no longer seems to?


It's working for me interactively. Are you getting any console errors?
aparajita
 
Posts: 177
Joined: Sun Jul 24, 2011 10:42 pm

Re: SublimeLint (Realtime lint highlighting)

Postby rdougan on Sat Aug 06, 2011 7:30 am

Nope, nothing. And I was debugging it last night (putting a bunch of 'print's everywhere) and the same things seemed to be called in the code. Very odd.
rdougan
 
Posts: 44
Joined: Sat Apr 09, 2011 2:37 am

Re: SublimeLint (Realtime lint highlighting)

Postby alexrussell on Thu Aug 11, 2011 1:33 pm

By the way there's a small and inconsequential bug in sublimelint. When there's nothing selected a bunch of errors go on the console. Basically the line which causes the error is in on_selection_modified where it assumes there's at least one selection.

A simple git diff for a fix is:

Code: Select all
diff --git a/sublimelint_plugin.py b/sublimelint_plugin.py
index e7e3293..c56fd04 100755
--- a/sublimelint_plugin.py
+++ b/sublimelint_plugin.py
@@ -181,8 +181,9 @@ class pyflakes(sublime_plugin.EventListener):

        def on_selection_modified(self, view):
                vid = view.id()
-               lineno = view.rowcol(view.sel()[0].end())[0]
-               if vid in lineMessages and lineno in lineMessages[vid]:
-                       view.set_status('pyflakes', '; '.join(lineMessages[vid][lineno]))
-               else:
-                       view.erase_status('pyflakes')
+               if len(view.sel()):
+                       lineno = view.rowcol(view.sel()[0].end())[0]
+                       if vid in lineMessages and lineno in lineMessages[vid]:
+                               view.set_status('pyflakes', '; '.join(lineMessages[vid][lineno]))
+                       else:
+                               view.erase_status('pyflakes')

As can be seen, all I've done is checked that there is at least one selection (using "if len(view.sel())") before executing the code on it. There may be other work that needs doing for this, (maybe adding an "else:" that does the "view.erase_status('pyflakes')" bit, I didn't want to get that far into it).

If you want a pull request let me know, but I'm not exactly all up on github and whatnot so I figured I'd just present the patch here in code and words.
alexrussell
 
Posts: 74
Joined: Fri Jul 15, 2011 9:06 am

Re: SublimeLint (Realtime lint highlighting)

Postby lunixbochs on Fri Aug 12, 2011 7:44 pm

even a single cursor selection counts as a selection with the same start/end point
lunixbochs
 
Posts: 91
Joined: Fri Oct 08, 2010 10:18 pm

Re: SublimeLint (Realtime lint highlighting)

Postby Cev on Thu Sep 01, 2011 4:13 pm

I'm having a problem where SublimeLint tries to parse HAML files as ruby, throwing errors in the process. Any ideas?
Cev
 
Posts: 1
Joined: Thu Sep 01, 2011 4:10 pm

Re: SublimeLint (Realtime lint highlighting)

Postby korgoth on Fri Sep 02, 2011 10:41 am

I cant seem to get this working for javascript

im on windows, and added nodejs to my path (node -v returns the current version)

When i try node <filename> it returns errors (ie javascript file contains errors), and on a correct file it returns nothing, but i dont see the borders appear where the errors actually are

Also is anyone interested or wiling to write a jquery linting plugin - that would be very very helpful with all the brackets in jquery :)


Any help is much appreciated

Thank you for this wonderful plugin!
korgoth
 
Posts: 4
Joined: Fri Sep 02, 2011 10:39 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Exabot [Bot] and 7 guests