Skip to content

Commit 4c75116

Browse files
committed
quick fix
1 parent 1dcc49f commit 4c75116

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codeflash/code_utils/formatter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ def format_code(formatter_cmds: list[str], path: Path, capture_output: bool = Tr
2727
formatter_cmd_list = [path.as_posix() if chunk == file_token else chunk for chunk in formatter_cmd_list]
2828
try:
2929
result = subprocess.run(formatter_cmd_list, capture_output=True, check=False)
30-
if result.returncode == 0 and capture_output:
31-
console.rule(f"Formatted Successfully with: {formatter_name.replace('$file', path.name)}")
30+
if result.returncode == 0:
31+
if capture_output:
32+
console.rule(f"Formatted Successfully with: {formatter_name.replace('$file', path.name)}")
3233
else:
3334
logger.error(f"Failed to format code with {' '.join(formatter_cmd_list)}")
3435
except FileNotFoundError as e:

0 commit comments

Comments
 (0)