File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 11import os
2+ import subprocess
23from functools import lru_cache
34from typing import Optional
5+
46from codeflash .cli_cmds .console import logger
57from codeflash .code_utils .shell_utils import read_api_key_from_shell_config
6- from codeflash .verification .test_runner import execute_test_subprocess
78
89
910def check_formatter_installed (formatter_cmds : list [str ]) -> bool :
1011 cmd_parts = formatter_cmds [0 ].split (" " )
1112 if "black" in cmd_parts or "ruff" in cmd_parts :
1213 formatter = cmd_parts [0 ]
1314 try :
14- execute_test_subprocess ([formatter ])
15+ subprocess . run ([formatter ], check = False )
1516 except (FileNotFoundError , NotADirectoryError ):
1617 logger .error (f"⚠️ Formatter not found: { formatter } , please ensure it is installed" )
1718 return False
1819 return True
1920
21+
2022@lru_cache (maxsize = 1 )
2123def get_codeflash_api_key () -> str :
2224 api_key = os .environ .get ("CODEFLASH_API_KEY" ) or read_api_key_from_shell_config ()
You can’t perform that action at this time.
0 commit comments