Skip to content

Commit 1dcc49f

Browse files
committed
quick fix
1 parent f9c2926 commit 1dcc49f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

codeflash/code_utils/formatter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def format_code(formatter_cmds: list[str], path: Path, capture_output: bool = Tr
2626
formatter_cmd_list = shlex.split(command, posix=os.name != "nt")
2727
formatter_cmd_list = [path.as_posix() if chunk == file_token else chunk for chunk in formatter_cmd_list]
2828
try:
29-
result = subprocess.run(formatter_cmd_list, capture_output=capture_output, check=False)
30-
if result.returncode == 0:
29+
result = subprocess.run(formatter_cmd_list, capture_output=True, check=False)
30+
if result.returncode == 0 and capture_output:
3131
console.rule(f"Formatted Successfully with: {formatter_name.replace('$file', path.name)}")
3232
else:
3333
logger.error(f"Failed to format code with {' '.join(formatter_cmd_list)}")

0 commit comments

Comments
 (0)