Skip to content

Commit 00226fa

Browse files
committed
Document the exclude config option
1 parent 7eb31ba commit 00226fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ Configuration
4545
``report_progress`` (default is ``False``) report basic progress to the LSP client.
4646
With this option, pylsp-mypy will report when mypy is running, given your editor supports LSP progress reporting. For small files this might produce annoying flashing in your editor, especially in with ``live_mode``. For large projects, enabling this can be helpful to assure yourself whether mypy is still running.
4747

48+
``exclude`` (default is ``[]``) A list of regular expressions which should be ignored.
49+
The ``mypy`` runner wil not be invoked when a document path is matched by one of the expressions. Note that this differs from the ``exclude`` directive of a ``mypy`` config which is only used for recursively discovering files when mypy is invoked on a whole directory.
50+
4851
This project supports the use of ``pyproject.toml`` for configuration. It is in fact the preferred way. Using that your configuration could look like this:
4952

5053
::
@@ -53,6 +56,7 @@ This project supports the use of ``pyproject.toml`` for configuration. It is in
5356
enabled = true
5457
live_mode = true
5558
strict = true
59+
exclude = ["tests/*"]
5660

5761
A ``pyproject.toml`` does not conflict with the legacy config file given that it does not contain a ``pylsp-mypy`` section. The following explanation uses the syntax of the legacy config file. However, all these options also apply to the ``pyproject.toml`` configuration (note the lowercase bools).
5862
Depending on your editor, the configuration (found in a file called pylsp-mypy.cfg in your workspace or a parent directory) should be roughly like this for a standard configuration:
@@ -62,7 +66,8 @@ Depending on your editor, the configuration (found in a file called pylsp-mypy.c
6266
{
6367
"enabled": True,
6468
"live_mode": True,
65-
"strict": False
69+
"strict": False,
70+
"exclude": ["tests/*"]
6671
}
6772

6873
With ``dmypy`` enabled your config should look like this:

0 commit comments

Comments
 (0)