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

ruff command line is missing subcommand when specifying executable in config #74

Closed
dfn-certling opened this issue Jan 11, 2024 · 1 comment · Fixed by #75
Closed

ruff command line is missing subcommand when specifying executable in config #74

dfn-certling opened this issue Jan 11, 2024 · 1 comment · Fixed by #75
Assignees

Comments

@dfn-certling
Copy link

If the executable is specified in the LSP config, the command line to run ruff is constructed and executed in

cmd = [executable]
cmd.extend(arguments)
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)

This call is missing the subcommand to actually execute with ruff. Compare to the call constructed for the fallback usage of the Python module in

cmd = [sys.executable, "-m", "ruff", str(subcommand)]
cmd.extend(arguments)
p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)

which includes str(subcommand).

Without the subcommand ruff seems to fallback to linting and does nothing to the buffer when trying to format through the LSP. Just adding str(subcommand) to the executable command fixes this for me.

@jhossbach
Copy link
Member

Hey @dfn-certling, thanks for the bug report! I will push a bugfix release today.

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 a pull request may close this issue.

2 participants