alecthomas / SublimeLinter-contrib-gometalinter

SublimeLinter plugin for gometalinter
MIT License
47 stars 13 forks source link

Lag while typing #7

Closed bcomnes closed 8 years ago

bcomnes commented 8 years ago

After installing the linter, and running gometalinter --install --update which probably gets me more linting than I possibly need (all of them), while type, I get some pretty serious delay and hiccups while typing.

Is it just that there is too much linting going on? Is there a setting I can throw that improves performance? Any tips that you have regarding this issue would be great :) Thanks!

alecthomas commented 8 years ago

Yeah this is weird. In theory, I believe, SublimeLinter is supposed to be asynchronous. In reality, it doesn't seem to be at all :(. So I believe this is actually an issue in SublimeLinter itself.

The workaround I use is to use the --fast flag for gometalinter. This is typically better for interactive linting anyway. You need something like this in your SublimeLinter User settings file:

            "gometalinter": {
                "@disable": false,
                "args": [
                    "--fast"
                ],
                "excludes": [],
                "ignore_match": []
            },

The other option is to configure SublimeLinter to only lint on save/load. Unfortunately I believe it will still lag, but it will only be during save and load.

alecthomas commented 8 years ago

Also, yes, there are a lot of messages by default. I exclude a whole bunch in my configuration:

            "gometalinter": {
                "@disable": false,
                "args": [
                    "--linter=vet:go tool vet -printfuncs=Infof,Debugf,Warningf,Errorf,Criticalf {path}/*.go:PATH:LINE:MESSAGE",
                    "--disable=dupl",
                    "--tests",
                    "--cyclo-over=15",
                    "--fast"
                ],
                "excludes": [],
                "ignore_match": [
                    ".*possible formatting directive in debug call.*",
                    ".*exported function (Test|Bench).*should have comment.*",
                    ".*error return value not checked.*(Close|Infof|Debugf|Warningf|Errorf).*",
                    ".*possible formatting directive in Error call.*",
                    ".*comment on exported.*",
                    ".*uses unkeyed fields.*",
                    ".*should have comment.*",
                    ".*bad syntax for struct tag pair.*",
                    ".*bad syntax for struct tag key.*"
                ]
            },