Skip to content

Commit dfc5177

Browse files
committed
covering cases where uv or uvx is used
1 parent cd63955 commit dfc5177

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codeflash/code_utils/env_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99

1010

1111
def check_formatter_installed(formatter_cmds: list[str]) -> bool:
12-
cmd_parts = shlex.split(formatter_cmds[0]," ")
13-
formatter = "black" if "black" in cmd_parts else "ruff" if "ruff" in cmd_parts else None
12+
clean_cmd = formatter_cmds[0].replace("uvx ","").replace("uv ","").replace("tool ","").replace("run ","")
13+
clean_cmd_parts = shlex.split(clean_cmd," ")
14+
formatter = "black" if "black" in clean_cmd_parts else "ruff" if "ruff" in clean_cmd_parts else clean_cmd_parts[0]
1415
if not formatter:
1516
try:
1617
subprocess.run([formatter], check=False)

0 commit comments

Comments
 (0)