You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install into the same virtualenv as python-lsp-server itself.
19
21
20
22
``pip install mypy-ls``
21
23
22
24
Configuration
23
25
-------------
24
26
25
-
``live_mode`` (default is True) provides type checking as you type. This writes to a tempfile every time a check is done.
27
+
``live_mode`` (default is True) provides type checking as you type.
28
+
This writes to a tempfile every time a check is done. Turning off ``live_mode`` means you must save your changes for mypy diagnostics to update correctly.
29
+
30
+
``dmypy`` (default is False) executes via ``dmypy run`` rather than ``mypy``.
31
+
This uses the ``dmypy`` daemon and may dramatically improve the responsiveness of the ``pylsp`` server, however this currently does not work in ``live_mode``. Enabling this disables ``live_mode``, even for conflicting configs.
32
+
33
+
``strict`` (defualt is False) refers to the ``strict`` option of ``mypy``.
34
+
This option often is too strict to be useful.
26
35
27
-
Turning off live_mode means you must save your changes for mypy diagnostics to update correctly.
28
36
29
-
Depending on your editor, the configuration (found in a file called mypy-ls.cfg in your workspace or a parent directory) should be roughly like this:
37
+
38
+
Depending on your editor, the configuration (found in a file called mypy-ls.cfg in your workspace or a parent directory) should be roughly like this for a standard configuration:
30
39
31
40
::
32
41
33
42
{
34
-
"enabled": True,
35
-
"live_mode": True,
36
-
"strict": False
43
+
"enabled": True,
44
+
"live_mode": True,
45
+
"strict": False
37
46
}
38
47
39
-
``dmypy`` (default is False) executes via `dmypy run` rather than `mypy`.
40
-
41
-
This uses the `dmypy` daemon and may dramatically improve the responsiveness of the `pylsp` server.
42
-
43
-
Depending on your editor, the configuration (found in a file called mypy-ls.cfg in your workspace or a parent directory) should be roughly like this:
48
+
With ``dmypy`` enabled your config should look like this:
44
49
45
50
::
46
51
47
52
{
48
-
"enabled": True,
49
-
"live_mode": False,
50
-
"dmypy": True,
51
-
"strict": False
53
+
"enabled": True,
54
+
"live_mode": False,
55
+
"dmypy": True,
56
+
"strict": False
52
57
}
58
+
59
+
Developing
60
+
-------------
61
+
62
+
Install development dependencies with (you might want to create a virtualenv first):
63
+
64
+
::
65
+
66
+
pip install -r requirements.txt
67
+
68
+
The project is formatted with `black`_. You can either configure your IDE to automatically format code with it, run it manually (``black .``) or rely on pre-commit (see below) to format files on git commit.
69
+
70
+
This project uses `pre-commit`_ to enforce code-quality. After cloning the repository install the pre-commit hooks with:
71
+
72
+
::
73
+
74
+
pre-commit install
75
+
76
+
After that pre-commit will run `all defined hooks`_ on every ``git commit`` and keep you from committing if there are any errors.
0 commit comments