Skip to content

Commit 7bff589

Browse files
authored
Update formatter.py
1 parent c6f7144 commit 7bff589

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

codeflash/code_utils/formatter.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,8 @@ def is_diff_line(line: str) -> bool:
9797

9898

9999
def format_generated_code(generated_test_source: str, formatter_cmds: list[str]) -> str:
100-
formatter_name = formatter_cmds[0].lower() if formatter_cmds else "disabled"
101-
if formatter_name == "disabled":
102-
return re.sub(r"\n{2,}", "\n\n", generated_test_source)
103100
with tempfile.TemporaryDirectory() as test_dir_str:
104-
# try running formatter, if nothing changes (could be due to formatting failing or no actual formatting needed)
101+
# try running formatter, if nothing changes (could be due to formatting failing or no actual formatting needed) return code with 2 or more newlines substituted with 2 newlines
105102
original_temp = Path(test_dir_str) / "original_temp.py"
106103
original_temp.write_text(generated_test_source, encoding="utf8")
107104
_, formatted_code, changed = apply_formatter_cmds(

0 commit comments

Comments
 (0)