Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion codeflash/code_utils/env_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ def check_formatter_installed(
if not formatter_cmds or formatter_cmds[0] == "disabled":
return True
first_cmd = formatter_cmds[0]
cmd_tokens = shlex.split(first_cmd) if isinstance(first_cmd, str) else [first_cmd]
# Fast path: avoid expensive shlex.split for simple strings without quotes
if " " not in first_cmd or ('"' not in first_cmd and "'" not in first_cmd):
cmd_tokens = first_cmd.split()
else:
cmd_tokens = shlex.split(first_cmd)

if not cmd_tokens:
return True
Expand Down
1 change: 0 additions & 1 deletion codeflash/languages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
reset_current_language,
set_current_language,
)

from codeflash.languages.registry import (
detect_project_language,
get_language_support,
Expand Down
2 changes: 1 addition & 1 deletion codeflash/languages/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def _ensure_languages_registered() -> None:
from codeflash.languages.python import support as _

with contextlib.suppress(ImportError):
from codeflash.languages.javascript import support as _ # noqa: F401
from codeflash.languages.javascript import support as _

with contextlib.suppress(ImportError):
from codeflash.languages.java import support as _ # noqa: F401
Expand Down
Loading