Skip to content

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

Closed

Description

@dfn-certling

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.

Activity

  1. jhossbach commented on Jan 12, 2024

    @jhossbach
    Member

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

  2. self-assigned this
    on Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions