-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use incremental mode (and daemon mode, once implemented) #14
Comments
Just to let you know, I've been using incremental mode without any issues. At least none that I can tell. |
You mean with What version of mypy are you running and how fast is it for you? |
Maybe I think I'm using incremental mode when actually fact I'm not. I just manually added
My mpy version is 0.560. If I uncomment the the
There were some issues with the regex matching for tmp file errors which I just fixed in #18, along with several other regex matching issues. So now when you uncomment |
I've tested it, and yes incremental is working for me, and it makes a huge difference. I intially made a mistake: I had incremental enabled in my project The runtime difference for my project is maybe ~2/3s vs 0.4/0.5s. Without incremental mode everything needs to be generated for each run. You can see the impact it has by enabling verbose mode in the plugin:
There are still some issues. Enabling it for unsaved files (commenting
You can fix those errors by always using the So instead of:
Always use this instead:
But I don't really know what shadow file does. It works, I just don't don't really know why. Mypy is is still slow-ish for realtime linting. My CPU spins a little when mypy runs, so when I have it enabled for unsaved files it's constantly whirring. |
I've looked into the mypy code to understand what shadow file actually does (took me a while to figure out), but it works as advertised. Thanks for looking into the |
Btw, the conditional for adding |
I have no idea why this isn't active by default since I don't see why mypy would need to create a cache dir (`.mypy_cache`) otherwise, but specifying this arg lowers runtime by about 50% for the SublimeLinter codebase, bringing it to about 1s on my machine. This actually makes it usable as a live linter using the --shadow-file arg, so we tell SL to do that. Closes #14.
👍 works like a charm. It seems even faster now in some situations, like when the file hasn't changed. Also, I'm now using the |
Upstream issue: python/mypy#3968
Hopefully this will speed up linting enough that we can enable checks for unsaved files.
The text was updated successfully, but these errors were encountered: