python-lsp/python-lsp-ruff

ruff command line is missing subcommand when specifying executable in config

dfn-certling opened this issue · 1 comments

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.

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