removed old code

This commit is contained in:
Alvin Ryanputra 2024-11-26 16:05:50 -05:00
parent a551019190
commit f673f4c95b

View file

@ -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])