File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 11"""Thanks for being curious about how codeflash works! If you might want to work with us on finally making performance a
22solved problem, please reach out to us at [email protected] . We're hiring! 33"""
4-
4+ import subprocess
55from pathlib import Path
6+ import sys
7+
8+ import click
69
710from codeflash .cli_cmds .cli import parse_args , process_pyproject_config
811from codeflash .cli_cmds .cmd_init import CODEFLASH_LOGO , ask_run_end_to_end_test
@@ -36,6 +39,14 @@ def main() -> None:
3639 ask_run_end_to_end_test (args )
3740 else :
3841 args = process_pyproject_config (args )
42+ if args .formatter_cmds [0 ].startswith ("black" ) or args .formatter_cmds [0 ].startswith ("uv" ):
43+ formatter = args .formatter_cmds [0 ].split (" " )[0 ]
44+ try :
45+ subprocess .run ([formatter ], capture_output = True , check = False )
46+ except (FileNotFoundError , NotADirectoryError ):
47+ click .echo (f"⚠️ Formatter not found: { formatter } , please ensure it is installed" )
48+ sys .exit (1 )
49+
3950 args .previous_checkpoint_functions = ask_should_use_checkpoint_get_functions (args )
4051 init_sentry (not args .disable_telemetry , exclude_errors = True )
4152 posthog_cf .initialize_posthog (not args .disable_telemetry )
You can’t perform that action at this time.
0 commit comments