SublimeLinter-mypy
SublimeLinter-mypy copied to clipboard
Use the new mypy daemon to speed up type-checking
Since mypy 0.6 there is a daemon included. So instead of running mypy as a command-line tool, one can run it as a long-running daemon (server) process and use a command-line client to send type-checking requests to the server. A speedup of 10x or more for large code bases seems possible. I think that would definetly be a large benefit for the speed of this Plugin. I would also gladly give a hand on implementation. Have a look at the daemon docu http://mypy.readthedocs.io/en/latest/mypy_daemon.html. It is still in beta state but already used in larger scale at Dropbox.
Thanks for the reference. I remember reading about it a few releases ago (https://github.com/fredcallaway/SublimeLinter-contrib-mypy/issues/14) but didn't find any info about it other than a small mention in the changelog.
From a quick look at that site, I can see a few problems, though. Notably:
- It doesn't seem to support
--shadow-file. - It doesn't support Windows. (that's not really a problem)
I would probably use the daemon behind a linter flag and have it disabled by default for the time being. The --timeout parameter is especially useful because we can not deinitialize the plugin when ST is closed. Not sure how to tackle the first problem without requesting support for it, though.
Small update as the upstream issue I was subscribed to was closed.
Not sure it's worth investigating because I'll need to manage the daemon in the plugin code. As long as --incremental does its job well (read: fast) enough, I'll hold back working on this. There are other more important things to manage.
Hello, I wanted to ask if there's going to be any work to implement dmypy soon, it would make it faster to use. Thanks
Yeah, I tried dmypy but it doesn't lint in the background (aka "while you type") and I hate it a bit when linters or feedback comes after saving only.