Skip to content

Commit 90a37e1

Browse files
authored
Merge
1 parent a17dbe2 commit 90a37e1

File tree

1 file changed

+45
-17
lines changed

1 file changed

+45
-17
lines changed

README.rst

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,46 +7,74 @@ Mypy plugin for PYLS
77
.. image:: https://github.com/Richardk2n/pyls-mypy/workflows/Python%20package/badge.svg?branch=master
88
:target: https://github.com/Richardk2n/pyls-mypy/
99

10-
This is a plugin for the Palantir's Python Language Server (https://github.com/palantir/python-language-server)
10+
This is a plugin for the `Python LSP Server`_.
11+
12+
.. _`Python LSP Server`: https://github.com/python-lsp/python-lsp-server
1113

1214
It, like mypy, requires Python 3.6 or newer.
1315

1416

1517
Installation
1618
------------
1719

18-
Install into the same virtualenv as pyls itself.
20+
Install into the same virtualenv as python-lsp-server itself.
1921

2022
``pip install mypy-ls``
2123

2224
Configuration
2325
-------------
2426

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.
2635

27-
Turning off live_mode means you must save your changes for mypy diagnostics to update correctly.
2836

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:
3039

3140
::
3241

3342
{
34-
"enabled": True,
35-
"live_mode": True,
36-
"strict": False
43+
"enabled": True,
44+
"live_mode": True,
45+
"strict": False
3746
}
3847

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:
4449

4550
::
4651

4752
{
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
5257
}
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.
77+
78+
.. _black: https://github.com/psf/black
79+
.. _pre-commit: https://pre-commit.com/
80+
.. _all defined hooks: .pre-commit-config.yaml

0 commit comments

Comments
 (0)