Skip to content

Commit cf4a665

Browse files
committed
more fixes for "ruff check"...
with --unsafe-fixes
1 parent af4df4a commit cf4a665

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

codeflash/optimization/function_optimizer.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
BestOptimization,
5050
CodeOptimizationContext,
5151
FunctionCalledInTest,
52-
FunctionParent,
5352
GeneratedTests,
5453
GeneratedTestsList,
5554
OptimizationSet,
@@ -79,7 +78,7 @@
7978

8079
from codeflash.discovery.functions_to_optimize import FunctionToOptimize
8180
from codeflash.either import Result
82-
from codeflash.models.models import BenchmarkKey, CoverageData, FunctionSource, OptimizedCandidate
81+
from codeflash.models.models import BenchmarkKey, CoverageData, FunctionParent, FunctionSource, OptimizedCandidate
8382
from codeflash.verification.verification_utils import TestConfig
8483

8584

@@ -299,9 +298,7 @@ def optimize_function(self) -> Result[BestOptimization, str]: # noqa: PLR0911
299298
self.log_successful_optimization(explanation, generated_tests, exp_type)
300299

301300
preexisting_functions_by_filepath: dict[Path, list[str]] = {}
302-
filepaths_to_inspect = [self.function_to_optimize.file_path] + list(
303-
{helper.file_path for helper in code_context.helper_functions}
304-
)
301+
filepaths_to_inspect = [self.function_to_optimize.file_path, *list({helper.file_path for helper in code_context.helper_functions})]
305302
for filepath in filepaths_to_inspect:
306303
source_code = filepath.read_text(encoding="utf8")
307304
preexisting_functions_by_filepath[filepath] = find_preexisting_objects(source_code)
@@ -610,7 +607,7 @@ def reformat_code_and_helpers(
610607
if should_sort_imports and isort.code(original_code) != original_code:
611608
should_sort_imports = False
612609

613-
paths = [fto_path] + list({hf.file_path for hf in helper_functions})
610+
paths = [fto_path, *list({hf.file_path for hf in helper_functions})]
614611
new_target_code = None
615612
new_helper_code: dict[Path, str] = {}
616613
for i, path in enumerate(paths):

0 commit comments

Comments
 (0)