Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5c3903e
will exit the cli if user doesn't have the formatter installed while …
aseembits93 May 20, 2025
3766ab4
moving things around
aseembits93 May 20, 2025
022d59b
typo
aseembits93 May 20, 2025
cf57fb1
ruff
aseembits93 May 20, 2025
4619f69
Update codeflash/optimization/optimizer.py
misrasaurabh1 May 20, 2025
1def2b4
refactoring
aseembits93 May 20, 2025
7ba496d
stash didnt work as expected
aseembits93 May 20, 2025
72519d5
Update env_utils.py
aseembits93 May 20, 2025
290f7b3
circular depenencies
aseembits93 May 20, 2025
ffbb167
minor fix
aseembits93 May 20, 2025
f484ff0
reduce duplication
aseembits93 May 20, 2025
f090a7a
Merge branch 'main' into fix-formatter-during-runtime
aseembits93 May 20, 2025
498f401
Merge branch 'main' into fix-formatter-during-runtime
aseembits93 May 20, 2025
cd63955
more pythonic
aseembits93 May 20, 2025
dfc5177
covering cases where uv or uvx is used
aseembits93 May 20, 2025
ac0894a
running all commands in list to ensure all run
aseembits93 May 20, 2025
6b27835
minor fixes
aseembits93 May 20, 2025
27fb8eb
Merge branch 'main' into fix-formatter-during-runtime
aseembits93 May 20, 2025
7f01823
bugfix
aseembits93 May 20, 2025
bc31a61
handle more exceptions
aseembits93 May 21, 2025
dfaa1cb
raise proper exception
KRRT7 May 21, 2025
130870e
Merge branch 'main' into fix-formatter-during-runtime
aseembits93 May 21, 2025
64edb0c
Merge branch 'main' into fix-formatter-during-runtime
misrasaurabh1 May 21, 2025
3334392
Merge branch 'main' into fix-formatter-during-runtime
misrasaurabh1 May 21, 2025
5507f8f
Merge branch 'main' into fix-formatter-during-runtime
aseembits93 May 21, 2025
baa747a
precommit fix
aseembits93 May 21, 2025
4cfaea0
Merge branch 'main' into fix-formatter-during-runtime
aseembits93 May 27, 2025
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
13 changes: 12 additions & 1 deletion codeflash/main.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
"""Thanks for being curious about how codeflash works! If you might want to work with us on finally making performance a
solved problem, please reach out to us at [email protected]. We're hiring!
"""

import subprocess
from pathlib import Path
import sys

import click

from codeflash.cli_cmds.cli import parse_args, process_pyproject_config
from codeflash.cli_cmds.cmd_init import CODEFLASH_LOGO, ask_run_end_to_end_test
Expand Down Expand Up @@ -36,6 +39,14 @@ def main() -> None:
ask_run_end_to_end_test(args)
else:
args = process_pyproject_config(args)
if args.formatter_cmds[0].startswith("black") or args.formatter_cmds[0].startswith("uv"):
formatter = args.formatter_cmds[0].split(" ")[0]
try:
subprocess.run([formatter], capture_output=True, check=False)
except (FileNotFoundError, NotADirectoryError):
click.echo(f"⚠️ Formatter not found: {formatter}, please ensure it is installed")
sys.exit(1)

args.previous_checkpoint_functions = ask_should_use_checkpoint_get_functions(args)
init_sentry(not args.disable_telemetry, exclude_errors=True)
posthog_cf.initialize_posthog(not args.disable_telemetry)
Expand Down
Loading