@@ -540,28 +540,9 @@ def run_ruff(
540
540
541
541
arguments = subcommand .build_args (document_path , settings , fix , extra_arguments )
542
542
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 )
565
546
566
547
log .debug (f"Calling { cmd } on '{ document_path } '" )
567
548
p = Popen (cmd , stdin = PIPE , stdout = PIPE )
0 commit comments