22
33import ast
44import os
5- import sys
65import tempfile
76import time
87from collections import defaultdict
98from pathlib import Path
109from typing import TYPE_CHECKING
1110
12- import click
13-
1411from codeflash .api .aiservice import AiServiceClient , LocalAiServiceClient
1512from codeflash .benchmarking .instrument_codeflash_trace import instrument_codeflash_trace_decorator
1613from codeflash .benchmarking .plugin .plugin import CodeFlashBenchmarkPlugin
2825from codeflash .models .models import BenchmarkKey , ValidCode
2926from codeflash .optimization .function_optimizer import FunctionOptimizer
3027from codeflash .telemetry .posthog_cf import ph
31- from codeflash .verification .test_runner import execute_test_subprocess
3228from codeflash .verification .verification_utils import TestConfig
3329
3430if TYPE_CHECKING :
@@ -80,6 +76,7 @@ def create_function_optimizer(
8076 )
8177
8278 def run (self ) -> None :
79+ < << << << Updated upstream
8380 if self .args .formatter_cmds [0 ].startswith ("black" ) or self .args .formatter_cmds [0 ].startswith ("ruff" ):
8481 formatter = self .args .formatter_cmds [0 ].split (" " )[0 ]
8582 try :
@@ -88,11 +85,15 @@ def run(self) -> None:
8885 click .echo (f"⚠️ Formatter not found: { formatter } , please ensure it is installed. Exiting..." )
8986 sys .exit (1 )
9087
88+ == == == =
89+ >> >> >> > Stashed changes
9190 ph ("cli-optimize-run-start" )
9291 logger .info ("Running optimizer." )
9392 console .rule ()
9493 if not env_utils .ensure_codeflash_api_key ():
9594 return
95+ if not env_utils .check_formatter_installed ():
96+ return
9697 function_optimizer = None
9798 file_to_funcs_to_optimize : dict [Path , list [FunctionToOptimize ]]
9899 num_optimizable_functions : int
0 commit comments