Skip to content

Commit 6ec5ef0

Browse files
committed
That should be hte last of the ruff stuff
1 parent d43862e commit 6ec5ef0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

codeflash/code_utils/formatter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def get_modification_code_ranges(
6868
preexisting_functions: set[tuple[str, tuple[FunctionParent, ...]]],
6969
helper_functions: list[FunctionSource],
7070
) -> list[tuple[int, int]]:
71-
"""Returns the starting and ending line numbers of modified and new functions in a file with edits."""
71+
"""Return the starting and ending line numbers of modified and new functions in a file with edits."""
7272
modified_functions = set()
7373
modified_functions.add(fto.qualified_name)
7474
for helper_function in helper_functions:

codeflash/optimization/function_optimizer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
from codeflash.verification.verification_utils import TestConfig
8383

8484

85+
class FunctionOptimizerError(Exception):
86+
pass
87+
88+
8589
class FunctionOptimizer:
8690
def __init__(
8791
self,
@@ -626,7 +630,7 @@ def reformat_code_and_helpers(
626630
)
627631

628632
if len(code_ranges_formatted) != len(code_ranges_unformatted):
629-
raise Exception("Formatting had unexpected effects on code ranges")
633+
raise FunctionOptimizerError("Formatting had unexpected effects on code ranges")
630634

631635
# It is important to sort in descending order so that the index arithmetic remains simple as we modify new_code
632636
code_ranges_unformatted.sort(key=lambda r: r[0], reverse=True)

0 commit comments

Comments
 (0)