Skip to content
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

Allow setting mypy/dmypy commands via config #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

heindsight
Copy link

This is an alternative to #57. Instead of requiring an external command to provide the commands to run mypy or dmypy are taken from configuration.

@vrslev
Copy link

vrslev commented Sep 30, 2024

It seems like this PR would resolve #90/rgbkrk/python-lsp-zed-extension#4 as well

@Richardk2n

command_key = f"{cmd}_command"
command: List[str] = settings.get(command_key, [])

if not command and shutil.which(cmd):
Copy link

@vrslev vrslev Sep 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be easier to comprehend:

    if command:
        return command

    if shutil.which(cmd):
        ...
        return [cmd]

    return command

Also, it looks like there is a hidden bug: if command is empty and shutil.which(cmd) == False, empty list would be returned, which is undesirable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants