Skip to content

Commit 9b0732a

Browse files
added a flag arg to skip draft pr optimization
1 parent 3de9198 commit 9b0732a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

codeflash/cli_cmds/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def parse_args() -> Namespace:
6262
type=str,
6363
help="Path to the directory of the project, where all the pytest-benchmark tests are located.",
6464
)
65+
parser.add_argument("--no-draft", default=False, action="store_true", help="Skip optimization for draft PRs")
66+
6567
args: Namespace = parser.parse_args()
6668
return process_and_validate_cmd_args(args)
6769

codeflash/optimization/optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def run(self) -> None:
8888
if not env_utils.check_formatter_installed(self.args.formatter_cmds):
8989
return
9090

91-
if is_pr_draft():
91+
if self.args.no_draft and is_pr_draft():
9292
logger.warning("PR is in draft mode, skipping optimization")
9393
return
9494

0 commit comments

Comments
 (0)