Skip to content

Commit

Permalink
Merge pull request #45 from tyoung-patreon/dmypy-fixes
Browse files Browse the repository at this point in the history
Use status and restart for dmypy
  • Loading branch information
Richardk2n authored Nov 20, 2022
2 parents 67209ba + 8b70857 commit 1c5a336
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pylsp_mypy/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ def pylsp_lint(
# dmypy exists on path
# -> use mypy on path
completed_process = subprocess.run(
["dmypy", *apply_overrides(args, overrides)], stderr=subprocess.PIPE, **windows_flag
["dmypy", "status"], stderr=subprocess.PIPE, **windows_flag
)
errors = completed_process.stderr.decode()
exit_status = completed_process.returncode
Expand All @@ -249,7 +249,7 @@ def pylsp_lint(
exit_status,
errors.strip(),
)
subprocess.run(["dmypy", "kill"], **windows_flag)
subprocess.run(["dmypy", "restart"], **windows_flag)
else:
# dmypy does not exist on path, but must exist in the env pylsp-mypy is installed in
# -> use dmypy via api
Expand All @@ -260,7 +260,7 @@ def pylsp_lint(
exit_status,
errors.strip(),
)
mypy_api.run_dmypy(["kill"])
mypy_api.run_dmypy(["restart"])

# run to use existing daemon or restart if required
args = ["run", "--"] + apply_overrides(args, overrides)
Expand Down

0 comments on commit 1c5a336

Please sign in to comment.