From 110c63ae95018154a442dc2094b2bcd27a866a7f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Fri, 11 Apr 2025 08:37:33 +1200 Subject: [PATCH] feat: Add --force flag to skip pre-push checks --- scripts/versionbump.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/versionbump.py b/scripts/versionbump.py index 2087ca939..02780a942 100755 --- a/scripts/versionbump.py +++ b/scripts/versionbump.py @@ -81,15 +81,22 @@ def main(): parser.add_argument( "--dry-run", action="store_true", help="Print each step without actually executing them" ) + parser.add_argument( + "--force", action="store_true", help="Skip pre-push checks" + ) args = parser.parse_args() dry_run = args.dry_run + force = args.force - # Perform checks before proceeding - check_branch() - check_working_directory_clean() - check_main_branch_up_to_date() - check_ok_to_push() + # Perform checks before proceeding unless --force is used + if not force: + check_branch() + check_working_directory_clean() + check_main_branch_up_to_date() + check_ok_to_push() + else: + print("Skipping pre-push checks due to --force flag.") new_version_str = args.new_version if not re.match(r"^\d+\.\d+\.\d+$", new_version_str):