Skip to content

Commit 2b13abf

Browse files
author
Tanner Young
committed
Use status, kill, start, and check for dmypy
1 parent 81cf8f4 commit 2b13abf

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pylsp_mypy/plugin.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def pylsp_lint(
239239
# dmypy exists on path
240240
# -> use mypy on path
241241
completed_process = subprocess.run(
242-
["dmypy", *apply_overrides(args, overrides)], stderr=subprocess.PIPE, **windows_flag
242+
["dmypy", "status"], stderr=subprocess.PIPE, **windows_flag
243243
)
244244
errors = completed_process.stderr.decode()
245245
exit_status = completed_process.returncode
@@ -250,6 +250,7 @@ def pylsp_lint(
250250
errors.strip(),
251251
)
252252
subprocess.run(["dmypy", "kill"], **windows_flag)
253+
subprocess.run(["dmypy", "start"], **windows_flag)
253254
else:
254255
# dmypy does not exist on path, but must exist in the env pylsp-mypy is installed in
255256
# -> use dmypy via api
@@ -261,9 +262,10 @@ def pylsp_lint(
261262
errors.strip(),
262263
)
263264
mypy_api.run_dmypy(["kill"])
265+
mypy_api.run_dmypy(["start"])
264266

265-
# run to use existing daemon or restart if required
266-
args = ["run", "--"] + apply_overrides(args, overrides)
267+
# use existing daemon
268+
args = ["check", "--"] + apply_overrides(args, overrides)
267269

268270
if shutil.which("dmypy"):
269271
# dmypy exists on path

0 commit comments

Comments
 (0)