Skip to content

Commit a625390

Browse files
committed
avoid appending to cached list
1 parent 621fdf2 commit a625390

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

pylsp_ruff/plugin.py

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -540,28 +540,9 @@ def run_ruff(
540540

541541
arguments = subcommand.build_args(document_path, settings, fix, extra_arguments)
542542

543-
# p = None
544-
# if executable is not None:
545-
# log.debug(f"Calling {executable} with args: {arguments} on '{document_path}'")
546-
# try:
547-
# cmd = [executable, str(subcommand)]
548-
# cmd.extend(arguments)
549-
# p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
550-
# (stdout, stderr) = p.communicate(document_source.encode())
551-
# except Exception:
552-
# log.error(f"Can't execute ruff with given executable '{executable}'.")
553-
# else:
554-
# cmd = [sys.executable, "-m", "ruff", str(subcommand)]
555-
# cmd.extend(arguments)
556-
# p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
557-
# (stdout, stderr) = p.communicate(document_source.encode())
558-
# if "No module named ruff" in stderr.decode():
559-
# cmd = [shutil.which("ruff"), str(subcommand)]
560-
#
561-
# p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
562-
# (stdout, stderr) = p.communicate(document_source.encode())
563-
cmd = find_executable(executable)
564-
cmd.extend([str(subcommand), *arguments])
543+
cmd = [*find_executable(executable), str(subcommand)]
544+
cmd.extend(arguments)
545+
print(cmd)
565546

566547
log.debug(f"Calling {cmd} on '{document_path}'")
567548
p = Popen(cmd, stdin=PIPE, stdout=PIPE)

0 commit comments

Comments
 (0)