File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 2525)
2626from codeflash .code_utils .env_utils import get_pr_number
2727from codeflash .code_utils .git_utils import get_git_diff , get_repo_owner_and_name
28- from codeflash .code_utils .time_utils import humanize_runtime
2928from codeflash .discovery .discover_unit_tests import discover_unit_tests
3029from codeflash .lsp .helpers import is_LSP_enabled
3130from codeflash .models .models import FunctionParent
@@ -244,13 +243,6 @@ def get_functions_to_optimize(
244243 )
245244
246245 logger .info (f"!lsp|Found { functions_count } function{ 's' if functions_count > 1 else '' } to optimize" )
247- if optimize_all :
248- three_min_in_ns = int (1.8e11 )
249- console .rule ()
250- logger .info (
251- f"It might take about { humanize_runtime (functions_count * three_min_in_ns )} to fully optimize this project. Codeflash "
252- f"will keep opening pull requests as it finds optimizations."
253- )
254246 return filtered_modified_functions , functions_count , trace_file_path
255247
256248
Original file line number Diff line number Diff line change 2222 create_worktree_snapshot_commit ,
2323 remove_worktree ,
2424)
25+ from codeflash .code_utils .time_utils import humanize_runtime
2526from codeflash .either import is_successful
2627from codeflash .models .models import ValidCode
2728from codeflash .telemetry .posthog_cf import ph
@@ -270,6 +271,16 @@ def run(self) -> None:
270271
271272 function_optimizer = None
272273 file_to_funcs_to_optimize , num_optimizable_functions , trace_file_path = self .get_optimizable_functions ()
274+ if self .args .all :
275+ three_min_in_ns = int (1.8e11 )
276+ console .rule ()
277+ pr_message = (
278+ "\n Codeflash will keep opening pull requests as it finds optimizations." if not self .args .no_pr else ""
279+ )
280+ logger .info (
281+ f"It might take about { humanize_runtime (num_optimizable_functions * three_min_in_ns )} to fully optimize this project.{ pr_message } "
282+ )
283+
273284 function_benchmark_timings , total_benchmark_timings = self .run_benchmarks (
274285 file_to_funcs_to_optimize , num_optimizable_functions
275286 )
You can’t perform that action at this time.
0 commit comments