Skip to content

Commit 42415d2

Browse files
committed
go
1 parent f0826bb commit 42415d2

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

codeflash/cli_cmds/cmd_init.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,4 +963,3 @@ def ask_for_telemetry() -> bool:
963963
default=True,
964964
show_default=True,
965965
)
966-

codeflash/code_utils/code_extractor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from codeflash.models.models import FunctionSource
2222

2323

24-
2524
class GlobalAssignmentCollector(cst.CSTVisitor):
2625
"""Collects all global assignment statements."""
2726

codeflash/context/code_context_extractor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def extract_code_string_context_from_files(
138138
helpers_of_fto: dict[Path, set[FunctionSource]],
139139
helpers_of_helpers: dict[Path, set[FunctionSource]],
140140
project_root_path: Path,
141-
remove_docstrings: bool = False,
141+
remove_docstrings: bool = False, # noqa: FBT001, FBT002
142142
code_context_type: CodeContextType = CodeContextType.READ_ONLY,
143143
) -> CodeString:
144144
"""Extract code context from files containing target functions and their helpers.
@@ -245,7 +245,7 @@ def extract_code_markdown_context_from_files(
245245
helpers_of_fto: dict[Path, set[FunctionSource]],
246246
helpers_of_helpers: dict[Path, set[FunctionSource]],
247247
project_root_path: Path,
248-
remove_docstrings: bool = False,
248+
remove_docstrings: bool = False, # noqa: FBT001, FBT002
249249
code_context_type: CodeContextType = CodeContextType.READ_ONLY,
250250
) -> CodeStringsMarkdown:
251251
"""Extract code context from files containing target functions and their helpers, formatting them as markdown.
@@ -271,12 +271,12 @@ def extract_code_markdown_context_from_files(
271271
"""
272272
# Rearrange to remove overlaps, so we only access each file path once
273273
helpers_of_helpers_no_overlap = defaultdict(set)
274-
for file_path in helpers_of_helpers:
274+
for file_path, helper_functions in helpers_of_helpers.items():
275275
if file_path in helpers_of_fto:
276276
# Remove duplicates within the same file path, in case a helper of helper is also a helper of fto
277277
helpers_of_helpers[file_path] -= helpers_of_fto[file_path]
278278
else:
279-
helpers_of_helpers_no_overlap[file_path] = helpers_of_helpers[file_path]
279+
helpers_of_helpers_no_overlap[file_path] = helper_functions
280280
code_context_markdown = CodeStringsMarkdown()
281281
# Extract code from file paths that contain fto and first degree helpers. helpers of helpers may also be included if they are in the same files
282282
for file_path, function_sources in helpers_of_fto.items():

codeflash/optimization/function_optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def determine_best_candidate(
404404
future_line_profile_results = None
405405
try:
406406
candidate = candidates.popleft()
407-
except IndexError as e:
407+
except IndexError:
408408
if done:
409409
break
410410
continue

0 commit comments

Comments
 (0)