We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98fba5e commit be2fa3aCopy full SHA for be2fa3a
codeflash/code_utils/formatter.py
@@ -110,15 +110,15 @@ def format_code(
110
# lsp mode
111
exit_on_failure = False
112
113
+ if isinstance(path, str):
114
+ path = Path(path)
115
+
116
# TODO: Only allow a particular whitelist of formatters here to prevent arbitrary code execution
117
formatter_name = formatter_cmds[0].lower() if formatter_cmds else "disabled"
118
if formatter_name == "disabled":
119
return path.read_text(encoding="utf8")
120
121
with tempfile.TemporaryDirectory() as test_dir_str:
- if isinstance(path, str):
- path = Path(path)
-
122
original_code = path.read_text(encoding="utf8")
123
original_code_lines = len(original_code.split("\n"))
124
0 commit comments