From fc9ba8c6e4e1d113107ce7b502512d98bf9ae006 Mon Sep 17 00:00:00 2001 From: Codeflash Bot Date: Fri, 14 Nov 2025 18:34:12 -0800 Subject: [PATCH] quick fix --- codeflash/code_utils/formatter.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codeflash/code_utils/formatter.py b/codeflash/code_utils/formatter.py index 82bbf0067..7b78dabda 100644 --- a/codeflash/code_utils/formatter.py +++ b/codeflash/code_utils/formatter.py @@ -97,6 +97,9 @@ def is_diff_line(line: str) -> bool: def format_generated_code(generated_test_source: str, formatter_cmds: list[str]) -> str: + formatter_name = formatter_cmds[0].lower() if formatter_cmds else "disabled" + if formatter_name == "disabled": # nothing to do if no formatter provided + return re.sub(r"\n{2,}", "\n\n", generated_test_source) with tempfile.TemporaryDirectory() as test_dir_str: # 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 original_temp = Path(test_dir_str) / "original_temp.py"