Skip to content

Commit 950e6cd

Browse files
committed
configurable follow-imports
1 parent dee6a6c commit 950e6cd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ Configuration
7373
- ``array`` of ``string`` items
7474
- **A list of regular expressions which should be ignored**. 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. For both windows or unix platforms you should use forward slashes (``/``) to indicate paths.
7575
- ``[]``
76+
* - ``follow-imports``
77+
- ``pylsp.plugins.pylsp_mypy.follow-imports``
78+
- ``normal``, ``silent``, ``skip`` or ``error``
79+
- ``mypy`` **parameter** ``follow-imports``. In ``mypy`` this is ``normal`` by default. We set it ``silent``, to sort out unwanted results. This can cause cash invalidation if you also run ``mypy`` in other ways. Setting this to ``normal`` avoids this at the cost of a small performance penalty.
80+
- ``silent``
7681

7782
Using a ``pyproject.toml`` for configuration, which is in fact the preferred way, your configuration could look like this:
7883

pylsp_mypy/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ def get_diagnostics(
301301
exit_status = 0
302302

303303
if not dmypy:
304-
args.extend(["--incremental", "--follow-imports", "silent"])
304+
args.extend(["--incremental", "--follow-imports", settings.get("follow-imports", "silent")])
305305
args = apply_overrides(args, overrides)
306306

307307
if shutil.which("mypy"):

0 commit comments

Comments
 (0)