Skip to content

Use status, kill, start, and check for dmypy #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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