mirror of
https://github.com/codeflash-ai/codeflash-internal.git
synced 2026-05-04 18:25:18 +00:00
removed old code
This commit is contained in:
parent
a551019190
commit
f673f4c95b
1 changed files with 0 additions and 33 deletions
|
|
@ -111,36 +111,3 @@ def has_test_functions(tree: ast.Module) -> bool:
|
|||
except StopIteration as found:
|
||||
return bool(found.value)
|
||||
return False
|
||||
|
||||
|
||||
#
|
||||
# def fix_future_imports(code_string: str) -> str:
|
||||
# """Moves any 'from __future__ import' statements to the beginning of the code.
|
||||
# Returns the modified code string.
|
||||
#
|
||||
# Args:
|
||||
# code_string (str): The input Python code as a string
|
||||
#
|
||||
# Returns:
|
||||
# str: Modified code with future imports at the start
|
||||
#
|
||||
# """
|
||||
# # Find all future imports using regex with line anchors
|
||||
# # ^\s* matches start of line followed by optional whitespace
|
||||
# # .*$ ensures we capture until the end of the line
|
||||
# future_pattern = r"^\s*from\s+_{2}future_{2}\s+import\s+[\w,\s]+(?:\n|$)"
|
||||
# future_imports = [match.strip() for match in re.findall(future_pattern, code_string, re.MULTILINE)]
|
||||
#
|
||||
# if not future_imports:
|
||||
# return code_string
|
||||
#
|
||||
# # Remove the future imports from original code
|
||||
# code_without_futures = code_string
|
||||
# for imp in future_imports:
|
||||
# code_without_futures = code_without_futures.replace(imp, "")
|
||||
#
|
||||
# # # Clean up any empty lines created
|
||||
# code_without_futures = "\n".join(line for line in code_without_futures.split("\n") if line.strip())
|
||||
#
|
||||
# # Combine future imports with remaining code
|
||||
# return "\n".join(future_imports + [""] + [code_without_futures])
|
||||
|
|
|
|||
Loading…
Reference in a new issue