Sublime Forum

SublimeLinter

#41

I have been using SublimeLinter for quite a while, and I am a big fan.

But sometimes when I am looking at other peoples code, it is quite painful if the person does not follow my exact ruleset.

I am not picking on this code at all; everyone codes different. But this is not fun to code in if I want to edit someones code without reformatting all of their code. And I really don’t want to have to turn it off everytime I pull up someones code that is not mine.


So here is a proposal: a low profile linting mode (optional of course)

It could even be taken one step further and the red underlines could be hidden but that can be left up to discussion. Clicking on the line still shows you the issue in the status bar, and I can easily see what is an error, what is a warning without making the code unreadable.

I have made this change locally, and I am looking for input from people to see if this would be a desired option before I bother forking and trying to submit a pull request.

Anyways, input would be nice so I can decide whether to try and get this pulled.

0 Likes

#42

I really like what you’ve done here, while my code is to my specs it doesn’t necessarily translate to the libraries I use.

Have you implemented keybindings to flip between ‘traditional’ and ‘minimalistic’ modes? I think that would be valuable.

0 Likes

#43

[quote=“dribble”]

I really like what you’ve done here, while my code is to my specs it doesn’t necessarily translate to the libraries I use.

Have you implemented keybindings to flip between ‘traditional’ and ‘minimalistic’ modes? I think that would be valuable.[/quote]

Hadn’t thought of that, that might be nice. That way if you really want to make sure you see everything, you can just toggle it. I can look into if it seems people are really digging this idea. I am currently not putting much effort into this until I get some more feedback, but I will make a not of this request.

0 Likes

#44

[quote=“facelessuser”]I have been using SublimeLinter for quite a while, and I am a big fan.

But sometimes when I am looking at other peoples code, it is quite painful if the person does not follow my exact ruleset.

I am not picking on this code at all; everyone codes different.[/quote]

[size=150]WHAT"S wrong with my first attempt at python?![/size]

[size=50]hehehe[/size]

Actually it’s quite discouraging, because I use Linter as well and I made sure to get rid of all those syntactical issues.

So either that’s an old version of the code or something is different between us: Linter Settings or the Source Code in question. (I’m assuming an old version of source; let me know if it is still syntacticly awful [accessible via package control])

Regardless, not a bad idea. Sincerely, I’m glad my failed attempt at coding actually sparked a creative idea!

0 Likes

#45

@viisual, it is an old version I believe. I am not at all picking on your code, trust me. There are a number of plugins by more experienced python people out there that cause a bunch of highlighting. Just because the linter marks a line, it doesn’t mean the code isn’t sound; just that it isn’t following the format rules of that I have set in my linter settings. Yours was the first file I grabbed that really highlighted a bunch.

I just wanted to show how code could look. Having to turn off the linter doesn’t give me feed back on the lines I am touching, but leaving it on makes it hard to read. The alternative is to have it highlight only on save, but I personally like having the instant feedback.

I don’t even know if people will go for this approach; I just thought I would throw it out there. SublimeLinter was the first plugin I thought of when I realized you could change the gutter icons.

I checked out the SublimeLinter repository and I saw a bunch of pull requests, some that have been there a while. So I am not sure if/when this could/would ever get pulled. From what I understand from reading this thread, the maintainer doesn’t really have the time they used to have.

No hard feeling hopefully. I think your plugin is pretty cool, I wouldn’t have had it on my computer to use if I didn’t like it :smile:.

0 Likes

#46

@viisual, since you asked, the one from Package control still has a lot of lint warnings and such. The only setting I disable is the 80 chars per line warning.

It is mainly things like trailing spaces, using tabs instead of spaces, variables set but not used, un-needed semi-colons, and lastly spaces after “(” or before “)”. None of these are big deals, the code is sound, and some people straight up don’t like some of these rules. It is no big deal. I have strict rules for my python plugins just so I don’t cause the linter to highlight a bunch of lines when someone from the community tries to make edits to my plugin. Someone once made a complaint when I had a pull request about not following PEP8 standards, so I started following PEP8 standards. I just really want to minimalize the feedback.

I want the linter to show me what I need to know without hindering me.

0 Likes

#47

Just to start discussion:

Gutter icons are nice, but too many gutter icons is… too much.

IMHO, when there is so many gutter icons like the print screen of low profile linting mode, it become almost useless.
Same for BracketHighlighter, I first liked the idea but now find it counter productive.

Add to the equation that only one gutter icon could be displayed per line, and it become a mess when used by more than one plugin.

But I like the idea of low profile mode for linter :smile:

0 Likes

#48

[quote=“facelessuser”]@viisual, it is an old version I believe. I am not at all picking on your code, trust me.

No hard feeling hopefully. I think your plugin is pretty cool, I wouldn’t have had it on my computer to use if I didn’t like it :smile:.[/quote]

Maybe I should have been more playful with my response, surely I wasn’t sincere.

In fact I used the Linter on a production JS file, which had countless lines of things highlighted I was … unaware were even plausible issues… but knowing how finicky some issues can be (trailing comma gotcha in IE6, for instance) I went ahead and applied the suggested Linter changes.

What would have taken me 30m-6h of debugging (IE6 really is a jerk, and terrible to deduce issues with) took all of 5 minutes.

Linter rocks.

And your idea is a good one.

0 Likes

#49

[quote=“bizoo”]Just to start discussion:

Gutter icons are nice, but too many gutter icons is… too much.

IMHO, when there is so many gutter icons like the print screen of low profile linting mode, it become almost useless.
[/quote]

A very fair argument. This is just one proposal. What I am most interested in is getting the linter out of the way to let me code, but still alerting me. So what about this: Remove the outline in low profile mode and show a permanent lint status in the status bar like: SublimeLinter: 24 issues. The underlines could possibly remain.

[quote=“bizoo”]
Same for BracketHighlighter, I first liked the idea but now find it counter productive.

Add to the equation that only one gutter icon could be displayed per line, and it become a mess when used by more than one plugin.
But I like the idea of low profile mode for linter :smile:[/quote]

True. On the topic of BracketHighlighter, would you be interested in an option to only show icons when there is only one selection and no icons on multi-select? I understand that the effectiveness of the icons is lost when a bunch of selections are made. I think this might be a good compromise.

0 Likes

#50

Good idea, IMHO underlines are not too distracting.

0 Likes

#51

Most of those errors are PEP8 errors, which you can ignore with the pep8_ignore setting.

0 Likes

#52

The problem with hiding outlines is that some linters don’t underline at all because they don’t give character position information. You can also hide outlines by setting the outline color in the color theme to the background color of the window, which will effectively hide them.

0 Likes

#53

Did anyone ever figure out how to get this to work on Windows 7 64-bit? I installed WAMP and my SublimeLinter.sublime-settings looks like this:

"sublimelinter_executable_map":
{
    "php": "c:/wamp/bin/php/php5.3.8/php"
},

But it still says PHP is not found (and that’s the correct directory path). Sublime Text 2 beta 2181. Thanks

0 Likes

#54

The SublimeLinter prefs moved from Base File.sublime-settings to SublimeLinter.sublime-settings. Use Package Control to update to the latest version (v1.5.5), and select Preferences->Package Settings->SublimeLinter->Change log. There are instructions there on how to migrate your settings.

0 Likes

#55

Thanks for the reply aparajita, but I did a totally fresh install and the php setting I mentioned is in SublimeLinter.sublime-settings. That’s the only setting I’ve changed in SublimeLinter. Everyone else in the office has had the same results. Don’t know what else we’re missing :cry:

0 Likes

#56

great plugin :smile:

i want to turn off smarttabs or “mixed space with tabs” warnings, how can i do that?

0 Likes

#57

Which SublimeLinter.sublime-settings? You should only be editing the one reached via Preferences->Package Settings->SublimeLinter->Settings - User.

0 Likes

#58

[quote=“ManFromEarth”]great plugin :smile:

i want to turn off smarttabs or “mixed space with tabs” warnings, how can i do that?[/quote]

Thanks. SublimeLinter supports a dozen languages. I can’t magically figure out which one you are talking about.

0 Likes

#59

[quote=“aparajita”]

[quote=“ManFromEarth”]great plugin :smile:

i want to turn off smarttabs or “mixed space with tabs” warnings, how can i do that?[/quote]

Thanks. SublimeLinter supports a dozen languages. I can’t magically figure out which one you are talking about.[/quote]

JavaScript ;p

0 Likes

#60

@ManFromEarth: Open the SublimeLinter User settings file (Preferences > Package Settings > SublimeLinter > Settings - User) and set the “smarttabs” jshint setting to true.

If you have nothing in there to start with, that looks like this:

{
    "jshint_options":
    {
        "smarttabs": true
    }
}

This and other jshint options are documented on jshint.com/options/.

The README file (Preferences > Package Settings > SublimeLinter > README) is worth a look.

Thanks for a great plugin!

0 Likes